当前位置: 首页>>代码示例>>Python>>正文


Python Node.get_node_fqdn方法代码示例

本文整理汇总了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
开发者ID:sebrandon1,项目名称:fuel-web,代码行数:9,代码来源:node.py

示例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))
开发者ID:ymkins,项目名称:fuel-web,代码行数:22,代码来源:neutron_serializers.py

示例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)
        )
开发者ID:ekorekin,项目名称:fuel-web,代码行数:74,代码来源:nova_serializers.py


注:本文中的nailgun.objects.Node.get_node_fqdn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。