Exemplo n.º 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
Exemplo n.º 2
0
 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 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
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 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
Exemplo n.º 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
Exemplo n.º 10
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
Exemplo n.º 11
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
Exemplo n.º 12
0
 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 16
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
Exemplo n.º 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
Exemplo n.º 18
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
Exemplo n.º 19
0
 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
Exemplo n.º 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
Exemplo n.º 21
0
 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