def Run(self, args):
        api_version = registrations.GetApiVersionFromArgs(args)
        client = registrations.RegistrationsClient(api_version)
        args.registration = util.NormalizeResourceName(args.registration)
        registration_ref = args.CONCEPTS.registration.Parse()

        console_io.PromptContinue(
            'You are about to export registration \'{}\''.format(
                registration_ref.registrationsId),
            throw_if_unattended=True,
            cancel_on_no=True)

        response = client.Export(registration_ref)

        response = util.WaitForOperation(api_version, response, args.async_)
        log.ExportResource(
            registration_ref.Name(),
            'registration',
            is_async=args.async_,
            details=(
                'Note:\nRegistration remains valid until expiry. Manage it in '
                'Google Domains at https://domains.google.com/registrar, or '
                'see https://support.google.com/domains/answer/3251174 for '
                'more information.'))
        return response
Example #2
0
  def Run(self, args):
    parent = asset_utils.GetParentNameForExport(args.organization, args.project,
                                                args.folder)
    client = client_util.AssetExportClient(parent)
    operation = client.Export(args)

    log.ExportResource(parent, is_async=True, kind='root asset')
    log.status.Print('Use [{} {}] to check the status of the operation.'.format(
        OPERATION_DESCRIBE_COMMAND, operation.name))
    def Run(self, args):
        parent = asset_utils.GetParentNameForAnalyzeIamPolicy(
            args.organization, args.project, args.folder)
        client = client_util.IamPolicyAnalysisLongrunningClient(
            client_util.V1P4BETA1_API_VERSION)
        operation = client.Analyze(parent, args,
                                   client_util.V1P4BETA1_API_VERSION)

        log.ExportResource(parent, is_async=True, kind='root asset')
        log.status.Print(
            'Use [{} {}] to check the status of the operation.'.format(
                OPERATION_DESCRIBE_COMMAND, operation.name))
Example #4
0
    def Run(self, args):
        parent = asset_utils.GetParentNameForExport(args.organization,
                                                    args.project, args.folder)
        if args.content_type == 'relationship':
            client = client_util.AssetExportClient(
                parent, api_version=client_util.V1P7BETA1_API_VERSION)
        else:
            client = client_util.AssetExportClient(parent)
        operation = client.Export(args)

        log.ExportResource(parent, is_async=True, kind='root asset')
        log.status.Print(
            'Use [{} {}] to check the status of the operation.'.format(
                OPERATION_DESCRIBE_COMMAND, operation.name))
    def Run(self, args):
        parent = asset_utils.GetParentName(args.organization, args.project,
                                           args.folder)
        client = client_util.AssetExportClient(parent)
        operation = client.Export(args)

        prefix = self.ReleaseTrack().prefix
        if prefix:
            operation_describe_command = 'gcloud {} asset operations describe'.format(
                prefix)
        else:
            operation_describe_command = 'gcloud asset operations describe'
        log.ExportResource(parent, is_async=True, kind='root asset')
        log.status.Print(
            'Use [{} {}] to check the status of the operation.'.format(
                operation_describe_command, operation.name))
Example #6
0
    def Run(self, args):
        client = registrations.RegistrationsClient()
        args.registration = util.NormalizeResourceName(args.registration)
        registration_ref = args.CONCEPTS.registration.Parse()

        console_io.PromptContinue(
            'You are about to export registration \'{}\''.format(
                registration_ref.registrationsId),
            throw_if_unattended=True,
            cancel_on_no=True)

        response = client.Export(registration_ref)

        response = util.WaitForOperation(response, args.async_)
        log.ExportResource(
            registration_ref.Name(),
            'registration',
            is_async=args.async_,
            details=('Note:\nRegistration remains valid until expiry. See '
                     'https://support.google.com/domains/answer/6339340 for '
                     'information how to access it in Google Domains.'))
        return response