Exemplo n.º 1
0
 def list_deployments(self):
     deployments = self.app_v1_api.list_deployment_for_all_namespaces()
     deployment_list = []
     for d in deployments.items:
         deployment = Deployment(name=d.metadata.name, ready_replicas=d.status.ready_replicas,
                                 replicas=d.status.replicas, namespace=d.metadata.namespace)
         deployment_list.append(deployment.__dict__)
     return deployment_list
Exemplo n.º 2
0
 def list_deployments(self):
     deployment_list = []
     try:
         deployments = self.app_v1_api.list_deployment_for_all_namespaces()
         for d in deployments.items:
             deployment = Deployment(name=d.metadata.name, ready_replicas=d.status.ready_replicas,
                                     replicas=d.status.replicas, namespace=d.metadata.namespace)
             deployment_list.append(deployment.__dict__)
     except ApiException as e:
         logger.error(msg='list namespace error ' + e.reason, exc_info=True)
     return deployment_list