Ejemplo n.º 1
0
 def get_clusters_info(self):
     clusters = ClusterCollection.all()
     clusters_info = []
     for cluster in clusters:
         release = cluster.release
         nodes_num = NodeCollection.filter_by(
             None, cluster_id=cluster.id).count()
         cluster_info = {
             'id': cluster.id,
             'nodes_num': nodes_num,
             'release': {
                 'os': release.operating_system,
                 'name': release.name,
                 'version': release.version
             },
             'mode': cluster.mode,
             'nodes': self.get_nodes_info(cluster.nodes),
             'node_groups': self.get_node_groups_info(cluster.node_groups),
             'status': cluster.status,
             'attributes': self.get_attributes(cluster.attributes.editable,
                                               self.attributes_white_list),
             'vmware_attributes': self.get_attributes(
                 cluster.vmware_attributes.editable,
                 self.vmware_attributes_white_list
             ),
             'net_provider': cluster.net_provider,
             'fuel_version': cluster.fuel_version,
             'is_customized': cluster.is_customized,
             'network_configuration': self.get_network_configuration_info(
                 cluster),
             'installed_plugins': self.get_cluster_plugins_info(cluster)
         }
         clusters_info.append(cluster_info)
     return clusters_info
Ejemplo n.º 2
0
 def get_clusters_info(self):
     clusters = ClusterCollection.all()
     clusters_info = []
     for cluster in clusters:
         release = cluster.release
         nodes_num = NodeCollection.filter_by(
             None, cluster_id=cluster.id).count()
         cluster_info = {
             'id': cluster.id,
             'nodes_num': nodes_num,
             'release': {
                 'os': release.operating_system,
                 'name': release.name,
                 'version': release.version
             },
             'mode': cluster.mode,
             'nodes': self.get_nodes_info(cluster.nodes),
             'node_groups': self.get_node_groups_info(cluster.node_groups),
             'status': cluster.status,
             'attributes': self.get_attributes(cluster.attributes.editable),
             'net_provider': cluster.net_provider,
             'fuel_version': cluster.fuel_version,
             'is_customized': cluster.is_customized,
             'openstack_info':
             self.get_openstack_info(cluster, cluster.nodes),
         }
         clusters_info.append(cluster_info)
     return clusters_info
Ejemplo n.º 3
0
 def get_clusters_info(self):
     clusters = ClusterCollection.all()
     clusters_info = []
     for cluster in clusters:
         release = cluster.release
         nodes_num = NodeCollection.filter_by(
             None, cluster_id=cluster.id).count()
         vmware_attributes_editable = None
         if cluster.vmware_attributes:
             vmware_attributes_editable = cluster.vmware_attributes.editable
         cluster_info = {
             'id':
             cluster.id,
             'nodes_num':
             nodes_num,
             'release': {
                 'os': release.operating_system,
                 'name': release.name,
                 'version': release.version
             },
             'mode':
             cluster.mode,
             'nodes':
             self.get_nodes_info(cluster.nodes),
             'node_groups':
             self.get_node_groups_info(cluster.node_groups),
             'status':
             cluster.status,
             'extensions':
             cluster.extensions,
             'attributes':
             self.get_attributes(Cluster.get_editable_attributes(cluster),
                                 self.attributes_white_list),
             'vmware_attributes':
             self.get_attributes(vmware_attributes_editable,
                                 self.vmware_attributes_white_list),
             'plugin_links':
             self.get_plugin_links(cluster.plugin_links),
             'net_provider':
             cluster.net_provider,
             'fuel_version':
             cluster.fuel_version,
             'is_customized':
             cluster.is_customized,
             'network_configuration':
             self.get_network_configuration_info(cluster),
             'installed_plugins':
             self.get_cluster_plugins_info(cluster),
             'components':
             cluster.components,
             'cluster_plugins':
             cluster.cluster_plugins
         }
         clusters_info.append(cluster_info)
     return clusters_info
Ejemplo n.º 4
0
    def get_installation_info(self):
        clusters_info = self.get_clusters_info()
        allocated_nodes_num = sum([c['nodes_num'] for c in clusters_info])
        unallocated_nodes_num = NodeCollection.filter_by(
            None, cluster_id=None).count()

        info = {
            'master_node_uid': self.get_master_node_uid(),
            'fuel_release': self.fuel_release_info(),
            'clusters': clusters_info,
            'clusters_num': len(clusters_info),
            'allocated_nodes_num': allocated_nodes_num,
            'unallocated_nodes_num': unallocated_nodes_num
        }

        return info
Ejemplo n.º 5
0
    def get_installation_info(self):
        clusters_info = self.get_clusters_info()
        allocated_nodes_num = sum([c['nodes_num'] for c in clusters_info])
        unallocated_nodes_num = NodeCollection.filter_by(
            None, cluster_id=None).count()

        info = {
            'user_information': self.get_user_info(),
            'master_node_uid': self.get_master_node_uid(),
            'fuel_release': self.fuel_release_info(),
            'clusters': clusters_info,
            'clusters_num': len(clusters_info),
            'allocated_nodes_num': allocated_nodes_num,
            'unallocated_nodes_num': unallocated_nodes_num
        }

        return info
Ejemplo n.º 6
0
 def get_clusters_info(self):
     clusters = ClusterCollection.all()
     clusters_info = []
     for cluster in clusters:
         release = cluster.release
         nodes_num = NodeCollection.filter_by(
             None, cluster_id=cluster.id).count()
         cluster_info = {
             'id': cluster.id,
             'nodes_num': nodes_num,
             'release': {
                 'os': release.operating_system,
                 'name': release.name,
                 'version': release.version
             },
             'mode': cluster.mode,
             'nodes': self.get_nodes_info(cluster.nodes),
             'status': cluster.status
         }
         clusters_info.append(cluster_info)
     return clusters_info
Ejemplo n.º 7
0
 def get_clusters_info(self):
     clusters = ClusterCollection.all()
     clusters_info = []
     for cluster in clusters:
         release = cluster.release
         nodes_num = NodeCollection.filter_by(
             None, cluster_id=cluster.id).count()
         cluster_info = {
             'id': cluster.id,
             'nodes_num': nodes_num,
             'release': {
                 'os': release.operating_system,
                 'name': release.name,
                 'version': release.version
             },
             'mode': cluster.mode,
             'nodes': self.get_nodes_info(cluster.nodes),
             'node_groups': self.get_node_groups_info(cluster.node_groups),
             'status': cluster.status,
             'extensions': cluster.extensions,
             'attributes': self.get_attributes(
                 Cluster.get_editable_attributes(cluster),
                 self.attributes_white_list
             ),
             'plugin_links': self.get_plugin_links(
                 cluster.plugin_links),
             'net_provider': cluster.net_provider,
             'fuel_version': cluster.fuel_version,
             'is_customized': cluster.is_customized,
             'network_configuration': self.get_network_configuration_info(
                 cluster),
             'installed_plugins': self.get_cluster_plugins_info(cluster),
             'components': cluster.components,
             'cluster_plugins': cluster.cluster_plugins,
             'roles_metadata': cluster.roles_metadata,
             'tags_metadata': cluster.tags_metadata,
             'volumes_metadata': cluster.volumes_metadata,
         }
         clusters_info.append(cluster_info)
     return clusters_info