def Run(self, args):
        privatecloud = args.CONCEPTS.private_cloud.Parse()
        client = PrivateCloudsClient()
        is_async = args.async_
        operation = client.Delete(privatecloud, args.delay_hours)
        if is_async:
            log.DeletedResource(operation.name,
                                kind='private cloud',
                                is_async=True)
            return operation

        return client.WaitForOperation(
            operation_ref=client.GetOperationRef(operation),
            message='waiting for private cloud [{}] to be deleted'.format(
                privatecloud.RelativeName()),
            has_result=False)
    def Run(self, args):
        resource = args.CONCEPTS.private_cloud.Parse()
        client = PrivateCloudsClient()
        is_async = args.async_
        operation = client.ResetVcenterCredentials(resource)
        if is_async:
            log.UpdatedResource(operation.name,
                                kind='vcenter credentials',
                                is_async=True)
            return operation

        resource = client.WaitForOperation(
            operation_ref=client.GetOperationRef(operation),
            message='waiting for vcenter credentials [{}] to be reset'.format(
                resource.RelativeName()))
        log.UpdatedResource(resource, kind='vcenter credentials')
        return resource
Example #3
0
    def Run(self, args):
        privatecloud = args.CONCEPTS.private_cloud.Parse()
        client = PrivateCloudsClient()
        is_async = args.async_
        operation = client.Update(privatecloud, description=args.description)
        if is_async:
            log.UpdatedResource(operation.name,
                                kind='private cloud',
                                is_async=True)
            return operation

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

        return resource
Example #4
0
    def Run(self, args):
        privatecloud = args.CONCEPTS.private_cloud.Parse()
        client = PrivateCloudsClient()
        is_async = args.async_
        operation = client.Create(privatecloud, args.description, args.cluster,
                                  args.node_type, args.node_count,
                                  args.management_range, args.network,
                                  args.vmware_engine_network,
                                  args.network_project,
                                  args.node_custom_core_count)
        if is_async:
            log.CreatedResource(operation.name,
                                kind='private cloud',
                                is_async=True)
            return operation

        resource = client.WaitForOperation(
            operation_ref=client.GetOperationRef(operation),
            message='waiting for private cloud [{}] to be created'.format(
                privatecloud.RelativeName()))
        log.CreatedResource(resource, kind='private cloud')

        return resource
Example #5
0
  def Run(self, args):
    location = args.CONCEPTS.location.Parse()

    client = PrivateCloudsClient()
    return client.List(location, limit=args.limit)
Example #6
0
 def Run(self, args):
     resource = args.CONCEPTS.private_cloud.Parse()
     client = PrivateCloudsClient()
     return client.GetVcenterCredentials(resource)