コード例 #1
0
 def convert_with_links(rpc_federation, limit, url=None, expand=False,
                        **kwargs):
     collection = FederationCollection()
     collection.federations = [Federation.convert_with_links(p, expand)
                               for p in rpc_federation]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #2
0
ファイル: baymodel.py プロジェクト: sidx64/magnum
 def convert_with_links(rpc_baymodels, limit, url=None, expand=False,
                        **kwargs):
     collection = BayModelCollection()
     collection.baymodels = [BayModel.convert_with_links(p, expand)
                             for p in rpc_baymodels]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #3
0
 def convert(quotas, limit, **kwargs):
     collection = QuotaCollection()
     collection.quotas = [Quota.convert(p) for p in quotas]
     collection.next = collection.get_next(limit,
                                           marker_attribute='id',
                                           **kwargs)
     return collection
コード例 #4
0
 def convert_with_links(rpc_x509keypairs, limit, url=None,
                        expand=False, **kwargs):
     collection = X509KeyPairCollection()
     collection.x509keypairs = [X509KeyPair.convert_with_links(p, expand)
                                for p in rpc_x509keypairs]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #5
0
ファイル: baymodel.py プロジェクト: sandhya-92/magnum
 def convert_with_links(rpc_baymodels, limit, url=None, expand=False,
                        **kwargs):
     collection = BayModelCollection()
     collection.baymodels = [BayModel.convert_with_links(p, expand)
                             for p in rpc_baymodels]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #6
0
ファイル: container.py プロジェクト: digambar15/magnum-1
 def convert_with_links(rpc_containers, limit, url=None,
                        expand=False, **kwargs):
     collection = ContainerCollection()
     collection.containers = [Container.convert_with_links(p, expand)
                         for p in rpc_containers]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #7
0
ファイル: service.py プロジェクト: Gobella/magnum
 def convert_with_links(rpc_services, limit, url=None,
                        expand=False, **kwargs):
     collection = ServiceCollection()
     collection.services = [Service.convert_with_links(p, expand)
                            for p in rpc_services]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #8
0
ファイル: node.py プロジェクト: wenchma/magnum
 def convert_with_links(rpc_nodes, limit, url=None, expand=False, **kwargs):
     collection = NodeCollection()
     collection.nodes = [
         Node.convert_with_links(p, expand) for p in rpc_nodes
     ]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #9
0
 def convert_with_links(rpc_clusters, limit, url=None, expand=False,
                        **kwargs):
     collection = ClusterCollection()
     collection.clusters = [Cluster.convert_with_links(p, expand)
                            for p in rpc_clusters]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #10
0
ファイル: quota.py プロジェクト: charliekang/magnum
 def convert(quotas, limit, **kwargs):
     collection = QuotaCollection()
     collection.quotas = [Quota.convert(p) for p in quotas]
     collection.next = collection.get_next(limit,
                                           marker_attribute='id',
                                           **kwargs)
     return collection
コード例 #11
0
ファイル: x509keypair.py プロジェクト: sandhya-92/magnum
 def convert_with_links(rpc_x509keypairs, limit, url=None,
                        expand=False, **kwargs):
     collection = X509KeyPairCollection()
     collection.x509keypairs = [X509KeyPair.convert_with_links(p, expand)
                                for p in rpc_x509keypairs]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #12
0
ファイル: nodegroup.py プロジェクト: stackhpc/magnum
 def convert(nodegroups, cluster_id, limit, expand=True, **kwargs):
     collection = NodeGroupCollection()
     collection.nodegroups = [
         NodeGroup.convert(ng, expand) for ng in nodegroups
     ]
     url = "clusters/%s/nodegroups" % cluster_id
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #13
0
 def convert_with_links(rpc_cluster_templates, limit, url=None, **kwargs):
     collection = ClusterTemplateCollection()
     collection.clustertemplates = [
         ClusterTemplate.convert_with_links(p)
         for p in rpc_cluster_templates
     ]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #14
0
 def convert_with_links(rpc_rcs, limit, url=None, expand=False, **kwargs):
     collection = ReplicationControllerCollection()
     collection.rcs = [
         ReplicationController.convert_with_links(p, expand)
         for p in rpc_rcs
     ]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #15
0
 def convert(nodegroups, limit, expand=True, **kwargs):
     collection = NodeGroupCollection()
     collection.nodegroups = [
         NodeGroup.convert(ng, expand) for ng in nodegroups
     ]
     collection.next = collection.get_next(limit,
                                           marker_attribute='id',
                                           **kwargs)
     return collection
コード例 #16
0
ファイル: magnum_services.py プロジェクト: AvnishPal/magnum
 def convert_db_rec_list_to_collection(servicegroup_api,
                                       rpc_msvcs, **kwargs):
     collection = MagnumServiceCollection()
     collection.mservices = []
     for p in rpc_msvcs:
         alive = servicegroup_api.service_is_up(p)
         state = 'up' if alive else 'down'
         msvc = MagnumService(state, **p.as_dict())
         collection.mservices.append(msvc)
     collection.next = collection.get_next(limit=None, url=None, **kwargs)
     return collection
コード例 #17
0
 def convert_db_rec_list_to_collection(servicegroup_api, rpc_msvcs,
                                       **kwargs):
     collection = MagnumServiceCollection()
     collection.mservices = []
     for p in rpc_msvcs:
         alive = servicegroup_api.service_is_up(p)
         state = 'up' if alive else 'down'
         msvc = MagnumService(state, **p.as_dict())
         collection.mservices.append(msvc)
     collection.next = collection.get_next(limit=None, url=None, **kwargs)
     return collection
コード例 #18
0
ファイル: cluster_template.py プロジェクト: ragnaray/magnum
 def convert_with_links(rpc_cluster_templates, limit, url=None, **kwargs):
     collection = ClusterTemplateCollection()
     collection.clustertemplates = [ClusterTemplate.convert_with_links(p)
                                    for p in rpc_cluster_templates]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #19
0
ファイル: pod.py プロジェクト: Tennyson53/magnum
 def convert_with_links(rpc_pods, limit, url=None, expand=False, **kwargs):
     collection = PodCollection()
     collection.pods = [Pod.convert_with_links(p, expand)
                        for p in rpc_pods]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #20
0
 def convert_with_links(rpc_rcs, limit, url=None, expand=False, **kwargs):
     collection = ReplicationControllerCollection()
     collection.rcs = [ReplicationController.convert_with_links(p, expand)
                       for p in rpc_rcs]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection
コード例 #21
0
ファイル: pod.py プロジェクト: drzaeus77/magnum
 def convert_with_links(rpc_pods, limit, url=None, expand=False, **kwargs):
     collection = PodCollection()
     collection.pods = [Pod.convert_with_links(p, expand) for p in rpc_pods]
     collection.next = collection.get_next(limit, url=url, **kwargs)
     return collection