Пример #1
0
 def Run(self, args):
     cluster = args.CONCEPTS.cluster.Parse()
     client = ClustersClient()
     operation = client.AddNodes(cluster, 1)
     return client.WaitForOperation(
         operation,
         'waiting for node to be added in the cluster [{}]'.format(cluster))
Пример #2
0
 def Run(self, args):
   cluster = args.CONCEPTS.cluster.Parse()
   client = ClustersClient()
   operation = client.Delete(cluster)
   return client.WaitForOperation(
       operation,
       'waiting for cluster [{}] to be deleted'.format(cluster),
       is_delete=True)
Пример #3
0
 def Run(self, args):
     cluster = args.CONCEPTS.cluster.Parse()
     client = ClustersClient()
     node_type = properties.VALUES.vmware.node_type.Get()
     node_count = args.node_count
     zone = args.zone
     operation = client.Create(cluster, node_count, node_type, zone,
                               args.labels)
     return client.WaitForOperation(
         operation,
         'waiting for cluster [{}] to be created'.format(cluster))
Пример #4
0
    def Run(self, args):
        cluster = args.CONCEPTS.cluster.Parse()
        client = ClustersClient()
        is_async = args.async_
        operation = client.Delete(cluster)
        if is_async:
            log.DeletedResource(operation.name, kind='cluster', is_async=True)
            return operation

        return client.WaitForOperation(
            operation_ref=client.GetOperationRef(operation),
            message='waiting for cluster [{}] to be deleted'.format(
                cluster.RelativeName()),
            has_result=False)
    def Run(self, args):
        cluster = args.CONCEPTS.cluster.Parse()
        client = ClustersClient()
        operation = client.Update(cluster, args.node_count)
        is_async = args.async_

        if is_async:
            log.UpdatedResource(operation.name, kind='cluster', is_async=True)
            return operation

        resource = client.WaitForOperation(
            operation_ref=client.GetOperationRef(operation),
            message='waiting for cluster [{}] to be updated'.format(
                cluster.RelativeName()))
        log.UpdatedResource(resource, kind='cluster')

        return resource
 def Run(self, args):
     cluster = args.CONCEPTS.cluster.Parse()
     client = ClustersClient()
     return client.Get(cluster)
Пример #7
0
 def Run(self, args):
     privatecloud = args.CONCEPTS.privatecloud.Parse()
     client = ClustersClient()
     return client.List(privatecloud, limit=args.limit)