def Args(parser): parser.display_info.AddFormat(machine_image_flags.DEFAULT_LIST_FORMAT) Create.MACHINE_IMAGE_ARG = machine_image_flags.MakeMachineImageArg() Create.MACHINE_IMAGE_ARG.AddArgument(parser, operation_type='create') parser.add_argument( '--description', help='Specifies a textual description of the machine image.') Create.SOURCE_INSTANCE = machine_image_flags.MakeSourceInstanceArg() Create.SOURCE_INSTANCE.AddArgument(parser)
def Args(parser): parser.display_info.AddFormat(machine_image_flags.DEFAULT_LIST_FORMAT) Create.MACHINE_IMAGE_ARG = machine_image_flags.MakeMachineImageArg() Create.MACHINE_IMAGE_ARG.AddArgument(parser, operation_type='create') parser.add_argument( '--description', help='Specifies a textual description of the machine image.') csek_utils.AddCsekKeyArgs(parser, resource_type='machine image') flags.AddStorageLocationFlag(parser, "machine image's") flags.AddGuestFlushFlag(parser, 'machine image') flags.AddSourceDiskCsekKeyArg(parser) kms_resource_args.AddKmsKeyResourceArg(parser, 'machine image') Create.SOURCE_INSTANCE = machine_image_flags.MakeSourceInstanceArg() Create.SOURCE_INSTANCE.AddArgument(parser)
def Args(cls, parser): parser.display_info.AddFormat(machine_image_flags.DEFAULT_LIST_FORMAT) Import.MACHINE_IMAGE_ARG = machine_image_flags.MakeMachineImageArg() Import.MACHINE_IMAGE_ARG.AddArgument(parser, operation_type='import') parser.add_argument( '--description', help='Specifies a text description of the machine image.') flags.AddStorageLocationFlag(parser, "machine image's") flags.AddGuestFlushFlag(parser, 'machine image') machine_image_flags.AddNoRestartOnFailureArgs(parser) machine_image_flags.AddTagsArgs(parser) machine_image_flags.AddCanIpForwardArgs(parser) machine_image_flags.AddNetworkArgs(parser) machine_image_flags.AddNetworkTierArgs(parser) instances_flags.AddMachineTypeArgs(parser) instances_flags.AddCustomMachineTypeArgs(parser) labels_util.AddCreateLabelsFlags(parser) daisy_utils.AddCommonDaisyArgs( parser, operation='an import') daisy_utils.AddExtraCommonDaisyArgs(parser) daisy_utils.AddOVFSourceUriArg(parser) parser.add_argument( '--os', required=False, choices=sorted(os_choices.OS_CHOICES_INSTANCE_IMPORT_BETA), help='Specifies the OS of the machine image being imported.') flags.AddZoneFlag( parser, 'machine image', 'import', explanation='The zone in which to perform the import of the machine image. ' + flags.ZONE_PROPERTY_EXPLANATION) daisy_utils.AddGuestEnvironmentArg(parser, 'machine image') parser.display_info.AddCacheUpdater(completers.InstancesCompleter) daisy_utils.AddNoAddressArg( parser, 'machine image import', docs_url='https://cloud.google.com/nat/docs/gce-example#create-nat ' + 'and https://cloud.google.com/vpc/docs/private-access-options#pga' )
def Args(parser): Delete.MACHINE_IMAGE_ARG = flags.MakeMachineImageArg(plural=True) Delete.MACHINE_IMAGE_ARG.AddArgument(parser, operation_type='delete')
def Args(parser): Describe.MACHINE_IMAGE_ARG = flags.MakeMachineImageArg() Describe.MACHINE_IMAGE_ARG.AddArgument(parser, operation_type='describe')
def Args(cls, parser): compute_holder = cls._GetComputeApiHolder(no_http=True) messages = compute_holder.client.messages parser.display_info.AddFormat(machine_image_flags.DEFAULT_LIST_FORMAT) Import.MACHINE_IMAGE_ARG = machine_image_flags.MakeMachineImageArg() Import.MACHINE_IMAGE_ARG.AddArgument(parser, operation_type='import') parser.add_argument( '--description', help='Specifies a text description of the machine image.') flags.AddStorageLocationFlag(parser, "machine image's") flags.AddGuestFlushFlag(parser, 'machine image') machine_image_flags.AddNoRestartOnFailureArgs(parser) machine_image_flags.AddTagsArgs(parser) machine_image_flags.AddCanIpForwardArgs(parser) machine_image_flags.AddNetworkArgs(parser) machine_image_flags.AddNetworkTierArgs(parser) instances_flags.AddMachineTypeArgs(parser) instances_flags.AddCustomMachineTypeArgs(parser) labels_util.AddCreateLabelsFlags(parser) daisy_utils.AddCommonDaisyArgs(parser, operation='an import') daisy_utils.AddOVFSourceUriArg(parser) if cls.ReleaseTrack() != base.ReleaseTrack.GA: image_utils.AddGuestOsFeaturesArgForImport(parser, messages) parser.add_argument( '--os', required=False, choices=sorted(os_choices.OS_CHOICES_INSTANCE_IMPORT_BETA), help='Specifies the OS of the machine image being imported.') daisy_utils.AddByolArg(parser) flags.AddZoneFlag( parser, 'machine image', 'import', explanation= 'The zone in which to perform the import of the machine image. ' + flags.ZONE_PROPERTY_EXPLANATION) daisy_utils.AddGuestEnvironmentArg(parser, 'machine image') parser.display_info.AddCacheUpdater(completers.InstancesCompleter) daisy_utils.AddNoAddressArg( parser, 'machine image import', docs_url= ('https://cloud.google.com/nat/docs/gce-example#create-nat ' 'and https://cloud.google.com/vpc/docs/private-access-options#pga' )) daisy_utils.AddComputeServiceAccountArg( parser, 'machine image import', daisy_utils.IMPORT_ROLES_FOR_COMPUTE_SERVICE_ACCOUNT) instances_flags.AddServiceAccountAndScopeArgs( parser, False, extra_scopes_help=( 'However, if neither `--scopes` nor `--no-scopes` are ' 'specified and the project has no default service ' 'account, then the machine image is imported with no ' 'scopes. Note that the level of access that a service ' 'account has is determined by a combination of access ' 'scopes and IAM roles so you must configure both ' 'access scopes and IAM roles for the service account ' 'to work properly.'), operation='Import', resource='machine image')