def _Args(parser, messages, supports_force_create=False): """Set Args based on Release Track.""" # GA Args parser.display_info.AddFormat(flags.LIST_FORMAT) sources_group = parser.add_mutually_exclusive_group(required=True) flags.AddCommonArgs(parser) flags.AddCommonSourcesArgs(parser, sources_group) Create.DISK_IMAGE_ARG = flags.MakeDiskImageArg() Create.DISK_IMAGE_ARG.AddArgument(parser, operation_type='create') csek_utils.AddCsekKeyArgs(parser, resource_type='image') labels_util.AddCreateLabelsFlags(parser) flags.MakeForceArg().AddToParser(parser) flags.AddCloningImagesArgs(parser, sources_group) flags.AddCreatingImageFromSnapshotArgs(parser, sources_group) image_utils.AddGuestOsFeaturesArg(parser, messages) kms_resource_args.AddKmsKeyResourceArg(parser, 'image') # Alpha and Beta Args if supports_force_create: # Deprecated as of Aug 2017. flags.MakeForceCreateArg().AddToParser(parser) parser.add_argument('--storage-location', metavar='LOCATION', help="""\ Specifies a Cloud Storage location, either regional or multi-regional, where image content is to be stored. If not specified, the multi-region location closest to the source is chosen automatically. """) compute_flags.AddShieldedInstanceInitialStateKeyArg(parser)
def _Args(parser, release_track, supports_kms_keys=False): """Set Args based on Release Track.""" # GA Args parser.display_info.AddFormat(flags.LIST_FORMAT) sources_group = parser.add_mutually_exclusive_group(required=True) flags.AddCommonArgs(parser) flags.AddCommonSourcesArgs(parser, sources_group) Create.DISK_IMAGE_ARG = flags.MakeDiskImageArg() Create.DISK_IMAGE_ARG.AddArgument(parser, operation_type='create') csek_utils.AddCsekKeyArgs(parser, resource_type='image') labels_util.AddCreateLabelsFlags(parser) flags.MakeForceArg().AddToParser(parser) flags.AddCloningImagesArgs(parser, sources_group) flags.AddCreatingImageFromSnapshotArgs(parser, sources_group) image_utils.AddGuestOsFeaturesArg(parser, release_track) # Alpha and Beta Args if release_track in (base.ReleaseTrack.BETA, base.ReleaseTrack.ALPHA): # Deprecated as of Aug 2017. flags.MakeForceCreateArg().AddToParser(parser) if supports_kms_keys: kms_resource_args.AddKmsKeyResourceArg(parser, 'image')
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArg(plural=True) _CommonArgs(parser) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.GA) _AddReplicaZonesArg(parser) kms_resource_args.AddKmsKeyResourceArg( parser, 'disk', region_fallthrough=True)
def _Args(parser, release_track, supports_force_create=False, supports_storage_location=False, supports_shielded_instance_initial_state=False): """Set Args based on Release Track.""" # GA Args parser.display_info.AddFormat(flags.LIST_FORMAT) sources_group = parser.add_mutually_exclusive_group(required=True) flags.AddCommonArgs(parser) flags.AddCommonSourcesArgs(parser, sources_group) Create.DISK_IMAGE_ARG = flags.MakeDiskImageArg() Create.DISK_IMAGE_ARG.AddArgument(parser, operation_type='create') csek_utils.AddCsekKeyArgs(parser, resource_type='image') labels_util.AddCreateLabelsFlags(parser) flags.MakeForceArg().AddToParser(parser) flags.AddCloningImagesArgs(parser, sources_group) flags.AddCreatingImageFromSnapshotArgs(parser, sources_group) image_utils.AddGuestOsFeaturesArg(parser, release_track) kms_resource_args.AddKmsKeyResourceArg(parser, 'image') # Alpha and Beta Args if supports_force_create: # Deprecated as of Aug 2017. flags.MakeForceCreateArg().AddToParser(parser) if supports_storage_location: compute_flags.AddStorageLocationFlag(parser, 'image') if supports_shielded_instance_initial_state: compute_flags.AddShieldedInstanceInitialStateKeyArg(parser)
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArgZonalOrRegional(plural=True) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.ALPHA) kms_utils.AddKmsKeyArgs(parser, resource_type='disk') _AddReplicaZonesArg(parser) _CommonArgs(parser, disks_flags.SOURCE_SNAPSHOT_ARG)
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArgZonalOrRegional(plural=True) _CommonArgs(parser, disks_flags.SOURCE_SNAPSHOT_ARG) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.BETA) _AddReplicaZonesArg(parser)
def Args(cls, parser): messages = cls._GetApiHolder(no_http=True).client.messages Create.disks_arg = disks_flags.MakeDiskArg(plural=True) _CommonArgs(parser) image_utils.AddGuestOsFeaturesArg(parser, messages) _AddReplicaZonesArg(parser) kms_resource_args.AddKmsKeyResourceArg( parser, 'disk', region_fallthrough=True)
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArg(plural=True) _CommonArgs(parser, include_physical_block_size_support=True) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.BETA) _AddReplicaZonesArg(parser) kms_resource_args.AddKmsKeyResourceArg(parser, 'disk', region_fallthrough=True)
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArgZonalOrRegional(plural=True) _CommonArgs(parser, disks_flags.SOURCE_SNAPSHOT_ARG) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.ALPHA) _AddReplicaZonesArg(parser) resource_flags.AddResourcePoliciesArgs(parser, 'added to') kms_resource_args.AddKmsKeyResourceArg( parser, 'disk', region_fallthrough=True)
def Args(cls, parser): messages = cls._GetApiHolder(no_http=True).client.messages Create.disks_arg = disks_flags.MakeDiskArg(plural=True) _CommonArgs(parser, include_physical_block_size_support=True, vss_erase_enabled=True) image_utils.AddGuestOsFeaturesArg(parser, messages) _AddReplicaZonesArg(parser) kms_resource_args.AddKmsKeyResourceArg(parser, 'disk', region_fallthrough=True)
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArgZonalOrRegional(plural=True) parser.add_argument( '--replica-zones', type=arg_parsers.ArgList(), metavar='ZONE1, ZONE2', help=('The zones regional disk will be replicated to. Required when ' 'creating regional disk.'), hidden=True) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.ALPHA) kms_utils.AddKmsKeyArgs(parser, resource_type='disk') _CommonArgs(parser, disks_flags.SOURCE_SNAPSHOT_ARG)
def Args(cls, parser): messages = cls._GetApiHolder(no_http=True).client.messages Create.disks_arg = disks_flags.MakeDiskArg(plural=True) _CommonArgs(parser, include_physical_block_size_support=True, vss_erase_enabled=True, source_instant_snapshot_enabled=True, support_pd_interface=True, support_provisioned_iops=True, support_user_licenses=True) image_utils.AddGuestOsFeaturesArg(parser, messages) _AddReplicaZonesArg(parser) kms_resource_args.AddKmsKeyResourceArg(parser, 'disk', region_fallthrough=True) disks_flags.AddMultiWriterFlag(parser)
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArg(plural=True) _CommonArgs( parser, include_physical_block_size_support=True, vss_erase_enabled=True, source_disk_enabled=True) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.ALPHA) _AddReplicaZonesArg(parser) kms_resource_args.AddKmsKeyResourceArg( parser, 'disk', region_fallthrough=True) parser.add_argument( '--multi-writer', action='store_true', help=('Create the disk in shared mode so that it can be attached with ' 'read-write access to multiple VMs. Available only for zonal ' 'disks. Cannot be used with regional disks. Shared disk is ' 'exposed only as an NVMe device. Shared PD does not yet support ' 'resize and snapshot operations.'))
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArgZonalOrRegional(plural=True) parser.add_argument( '--replica-zones', type=arg_parsers.ArgList(), metavar='ZONE1, ZONE2', help=('The zones regional disk will be replicated to. Required when ' 'creating regional disk.'), hidden=True) parser.add_argument( '--licenses', type=arg_parsers.ArgList(), metavar='LICENSE', help=('A list of URIs to license resources. The provided licenses will ' 'be added onto the created disks to indicate the licensing and ' 'billing policies.')) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.ALPHA) kms_utils.AddKmsKeyArgs(parser, resource_type='disk') _CommonArgs(parser, disks_flags.SOURCE_SNAPSHOT_ARG)
def Args(cls, parser): _Args(parser, cls.ReleaseTrack()) image_utils.AddGuestOsFeaturesArg(parser, cls.ReleaseTrack())
def Args(cls, parser): _Args(parser, cls.ReleaseTrack()) image_utils.AddGuestOsFeaturesArg(parser, cls.ReleaseTrack()) kms_utils.AddKmsKeyArgs(parser, resource_type='image') parser.display_info.AddCacheUpdater(flags.ImagesCompleter)
def _Args(parser, messages, supports_force_create=False, support_user_licenses=False, support_disk_architecture=False): """Set Args based on Release Track.""" # GA Args parser.display_info.AddFormat(flags.LIST_FORMAT) sources_group = parser.add_mutually_exclusive_group(required=True) flags.AddCommonArgs(parser, support_user_licenses=support_user_licenses) flags.AddCommonSourcesArgs(parser, sources_group) Create.DISK_IMAGE_ARG = flags.MakeDiskImageArg() Create.DISK_IMAGE_ARG.AddArgument(parser, operation_type='create') csek_utils.AddCsekKeyArgs(parser, resource_type='image') labels_util.AddCreateLabelsFlags(parser) flags.MakeForceArg().AddToParser(parser) flags.AddCloningImagesArgs(parser, sources_group) flags.AddCreatingImageFromSnapshotArgs(parser, sources_group) image_utils.AddGuestOsFeaturesArg(parser, messages) kms_resource_args.AddKmsKeyResourceArg(parser, 'image') flags.AddSourceDiskProjectFlag(parser) # Alpha and Beta Args if support_disk_architecture: image_utils.AddArchitectureArg(parser) if supports_force_create: # Deprecated as of Aug 2017. flags.MakeForceCreateArg().AddToParser(parser) parser.add_argument('--storage-location', metavar='LOCATION', help="""\ Specifies a Cloud Storage location, either regional or multi-regional, where image content is to be stored. If not specified, the multi-region location closest to the source is chosen automatically. """) parser.add_argument('--locked', action='store_true', default=None, hidden=True, help="""\ Specifies that any boot disk created from this image can't be used for data backup operations such as snapshot creation, image creation, instance snapshot creation, and disk cloning. If a VM instance is created using this image, the boot disk is fixed to this VM. The disk can't be attached to any other VMs, whether in `read-write` mode or in `read-only` mode. Also, any VM created from this disk, has the following characteristics: * The VM can't be used for creating machine images or instance templates * After the VM is created, you can't attach any secondary disk * After the VM is deleted, the attached boot disk can't be retained """) compute_flags.AddShieldedInstanceInitialStateKeyArg(parser)
def Args(parser): Create.disks_arg = disks_flags.MakeDiskArg(plural=True) _CommonArgs(parser, disks_flags.SOURCE_SNAPSHOT_ARG) image_utils.AddGuestOsFeaturesArg(parser, base.ReleaseTrack.GA)
def Args(cls, parser): _Args(parser, cls.ReleaseTrack()) image_utils.AddGuestOsFeaturesArg(parser, cls.ReleaseTrack()) kms_utils.AddKmsKeyArgs(parser, resource_type='image')
def Args(cls, parser): _Args(parser, cls.ReleaseTrack()) image_utils.AddGuestOsFeaturesArg(parser, cls.ReleaseTrack()) parser.display_info.AddCacheUpdater(flags.ImagesCompleter)