本文整理汇总了Python中nailgun.objects.Node.get_node_fqdn方法的典型用法代码示例。如果您正苦于以下问题:Python Node.get_node_fqdn方法的具体用法?Python Node.get_node_fqdn怎么用?Python Node.get_node_fqdn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nailgun.objects.Node
的用法示例。
在下文中一共展示了Node.get_node_fqdn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: serialize
# 需要导入模块: from nailgun.objects import Node [as 别名]
# 或者: from nailgun.objects.Node import get_node_fqdn [as 别名]
def serialize(cls, instance, fields=None):
from nailgun.objects import Node
data_dict = super(NodeSerializer, cls).serialize(instance, fields)
data_dict['fqdn'] = Node.get_node_fqdn(instance)
data_dict['status'] = Node.get_status(instance)
data_dict['tags'] = instance.tag_names
return data_dict
示例2: generate_network_metadata
# 需要导入模块: from nailgun.objects import Node [as 别名]
# 或者: from nailgun.objects.Node import get_node_fqdn [as 别名]
def generate_network_metadata(cls, cluster):
nodes = dict()
nm = Cluster.get_network_manager(cluster)
for node in Cluster.get_nodes_not_for_deletion(cluster):
name = Node.get_slave_name(node)
node_roles = Node.all_roles(node)
network_roles = cls.get_network_role_mapping_to_ip(node)
nodes[name] = {
"uid": node.uid,
"fqdn": Node.get_node_fqdn(node),
"name": name,
"user_node_name": node.name,
"swift_zone": node.uid,
"node_roles": node_roles,
"network_roles": network_roles,
}
return dict(nodes=nodes, vips=nm.assign_vips_for_net_groups(cluster))
示例3: generate_network_metadata
# 需要导入模块: from nailgun.objects import Node [as 别名]
# 或者: from nailgun.objects.Node import get_node_fqdn [as 别名]
def generate_network_metadata(cls, cluster):
nodes = dict()
nm = Cluster.get_network_manager(cluster)
for n in Cluster.get_nodes_not_for_deletion(cluster):
name = Node.get_slave_name(n)
node_roles = Node.all_roles(n)
# Use permanent identifier as a node key
key = Node.permanent_id(n)
ip_by_net = {
'fuelweb_admin': None,
'storage': None,
'management': None,
'public': None
}
networks = nm.get_node_networks(n)
for net in ip_by_net:
netgroup = nm.get_network_by_netname(net, networks)
if netgroup.get('ip'):
ip_by_net[net] = netgroup['ip'].split('/')[0]
netw_roles = {
'admin/pxe': ip_by_net['fuelweb_admin'],
'fw-admin': ip_by_net['fuelweb_admin'],
'keystone/api': ip_by_net['management'],
'swift/api': ip_by_net['management'],
'sahara/api': ip_by_net['management'],
'ceilometer/api': ip_by_net['management'],
'cinder/api': ip_by_net['management'],
'glance/api': ip_by_net['management'],
'heat/api': ip_by_net['management'],
'nova/api': ip_by_net['management'],
'murano/api': ip_by_net['management'],
'horizon': ip_by_net['management'],
'management': ip_by_net['management'],
'mgmt/database': ip_by_net['management'],
'mgmt/messaging': ip_by_net['management'],
'mgmt/corosync': ip_by_net['management'],
'mgmt/memcache': ip_by_net['management'],
'mgmt/vip': ip_by_net['management'],
'mongo/db': ip_by_net['management'],
'ceph/public': ip_by_net['management'],
'storage': ip_by_net['storage'],
'ceph/replication': ip_by_net['storage'],
'swift/replication': ip_by_net['storage'],
'cinder/iscsi': ip_by_net['storage'],
'ex': ip_by_net['public'],
'public/vip': ip_by_net['public'],
'ceph/radosgw': ip_by_net['public'],
}
nodes[key] = {
"uid": n.uid,
"fqdn": Node.get_node_fqdn(n),
"name": name,
"user_node_name": n.name,
"swift_zone": n.uid,
"node_roles": node_roles,
"network_roles": netw_roles
}
return dict(
nodes=nodes,
vips=nm.assign_vips_for_net_groups(cluster)
)