feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
source_volume_id:
api_field: diskMigrationJob.awsSourceDiskDetails.volumeId
arg_name: source-volume-id
required: true
help_text: |
The ID of the source volume that you want to migrate to Compute Engine.
labels:
api_field: diskMigrationJob.targetDetails.labels.additionalProperties
arg_name: labels
required: false
metavar: KEY=VALUE
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
help_text: |
A map of labels to associate with the disk.
target_project:
api_field: diskMigrationJob.targetDetails.targetProject
arg_name: target-project
required: false
help_text: |
The target project resource path to which the disk will be migrated.
Default is the host project.
To get a list of the target projects run the gcloud alpha migration vms target-projects list command.
kms_key:
api_field: diskMigrationJob.targetDetails.encryption.kmsKey
arg_name: kms-key
required: false
help_text: |
Fully qualified identifier for the Cloud KMS (Key Management Service) cryptokey that will be used to protect the disk.
disk_id:
api_field: diskMigrationJob.targetDetails.targetDisk.diskId
arg_name: disk-id
required: false
help_text: |
The ID of the disk that will be migrated to Compute Engine. The default value is the disk migration resource name.
zone:
api_field: diskMigrationJob.targetDetails.targetDisk.zone
arg_name: zone
required: false
help_text: |
The zone in which to create the disk. The default value is the first zone of the Google Cloud location parameter given.
disk_type:
api_field: diskMigrationJob.targetDetails.targetDisk.diskType
arg_name: disk-type
required: false
help_text: |
The Compute Engine disk type to use for the migrated disk. The default value is COMPUTE_ENGINE_DISK_TYPE_STANDARD.

View File

@@ -0,0 +1,174 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Argument processors for migration vms disk-migrations surface arguments."""
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.command_lib.migration.vms import hooks
from googlecloudsdk.generated_clients.apis.vmmigration.v1 import vmmigration_v1_messages
default_disk_type = (
vmmigration_v1_messages.ComputeEngineDisk.DiskTypeValueValuesEnum.COMPUTE_ENGINE_DISK_TYPE_STANDARD
)
def GetDiskMigrationJobTargetDetails(value):
"""Returns empty DiskMigrationJobTargetDetails entry.
Args:
value: A pointer to the DiskMigrationJobTargetDetails field in the request.
Returns:
An empty DiskMigrationJobTargetDetails entry.
"""
del value
return hooks.GetMessageClass(
'DiskMigrationJobTargetDetails'
)()
def GetComputeEngineDiskTransform(value):
"""Returns empty ComputeEngineDisk entry.
Args:
value: A pointer to the ComputeEngineDisk field in the request.
Returns:
An empty ComputeEngineDisk entry.
"""
del value
return hooks.GetMessageClass('ComputeEngineDisk')()
def GetDefaultZone(ref):
"""Returns the default zone for the given resource reference.
Args:
ref: The resource reference.
Returns:
The default zone for the given resource reference.
"""
return ExtractLocation(ref) + '-a'
def ExtractLocation(ref):
"""Extracts the location from the resource reference.
Args:
ref: The resource reference.
Returns:
The location of the resource reference.
"""
return ref.Parent().Parent().Name()
def GetProject(ref):
"""Returns the project name for the given resource reference.
Args:
ref: The resource reference.
Returns:
The project name for the given resource reference.
"""
return ref.Parent().Parent().Parent()
# Modify Request Hook For Disk Migration
def FixCreateDiskMigrationsRequest(ref, args, req):
"""Fixes the Create Disk Migration request.
Args:
ref: The resource reference.
args: The parsed arguments.
req: The request message.
Returns:
The modified request message.
"""
if getattr(req.diskMigrationJob, 'targetDetails', None) is None:
req.diskMigrationJob.targetDetails = (
GetDiskMigrationJobTargetDetails(
req.diskMigrationJob.targetDetails
)
)
if getattr(req.diskMigrationJob.targetDetails, 'targetDisk', None) is None:
req.diskMigrationJob.targetDetails.targetDisk = (
GetComputeEngineDiskTransform(
req.diskMigrationJob.targetDetails.targetDisk,
)
)
if not args.disk_id:
req.diskMigrationJob.targetDetails.targetDisk.diskId = ref.Name()
if not args.zone:
req.diskMigrationJob.targetDetails.targetDisk.zone = GetDefaultZone(ref)
if not args.disk_type:
req.diskMigrationJob.targetDetails.targetDisk.diskType = default_disk_type
hooks.FixTargetDetailsCommonFields(
GetProject(ref), args, req.diskMigrationJob.targetDetails
)
return req
# convert the gcloud flags to the api format#
# i.e. --adaptation-modifiers=flag1,flag2=value2
# will be converted to:
# [AdaptationModifier{'modifier': 'flag1'},
# AdaptationModifier{'modifier': 'flag2', 'value': 'value2'}]
def ProcessAdaptationModifiers(adaptation_modifiers):
"""Processes the adaptation modifiers to match the API format.
Args:
adaptation_modifiers: A string or a list of strings representing the
adaptation flags.
Returns:
A list of dictionaries, where each dictionary represents a key-value
pair with 'key' and 'value' fields.
"""
if not adaptation_modifiers:
return []
if isinstance(adaptation_modifiers, str):
flags_list = adaptation_modifiers.split(',')
elif isinstance(adaptation_modifiers, list):
flags_list = adaptation_modifiers
else:
raise arg_parsers.ArgumentTypeError(
'adaptation-modifiers must be a string or a list of strings.'
)
result = []
for flag in flags_list:
if not flag:
continue
if '=' not in flag:
adaptation_flag_message = hooks.GetMessageClass('AdaptationModifier')(
modifier=flag.strip()
)
else:
key, value = flag.split('=', 1)
adaptation_flag_message = hooks.GetMessageClass('AdaptationModifier')(
modifier=key.strip(), value=value.strip()
)
result.append(adaptation_flag_message)
return result

View File

@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Common argument processors for migration vms surface arguments."""
from googlecloudsdk.api_lib.util import apis
from googlecloudsdk.core import properties
# Helper Functions
def GetMessageClass(msg_type_name):
"""Gets API message object for given message type name."""
msg = apis.GetMessagesModule('vmmigration', 'v1')
return getattr(msg, msg_type_name)
# Argument Processors
def SetLocationAsGlobal():
"""Set default location to global."""
return 'global'
def FixTargetDetailsCommonFields(project_ref, args, target_details):
""""Fixes the target details common fields."""
if not args.target_project:
# Handle default target project being the host project.
target = args.project or properties.VALUES.core.project.Get(required=True)
target_details.targetProject = (
project_ref.RelativeName() +
'/locations/global/targetProjects/' + target
)
elif '/' not in args.target_project:
# Handle prepending path to target project short-name.
target_details.targetProject = (
project_ref.RelativeName() +
'/locations/global/targetProjects/' + args.target_project
)

View File

@@ -0,0 +1,135 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
image_name:
api_field: imageImport.diskImageTargetDefaults.imageName
arg_name: image-name
help_text: |
The name of the image that will be imported to Google Compute Engine.
Default is the Image Import name.
target_project:
api_field: imageImport.diskImageTargetDefaults.targetProject
arg_name: target-project
help_text: |
The target project resource path to which the image will be imported.
Default is the customer project.
To get a list of the target projects run the gcloud alpha migration vms target-projects list command.
license_type:
api_field: imageImport.diskImageTargetDefaults.osAdaptationParameters.licenseType
arg_name: license-type
required: false
help_text: |
The license to use post migration.
generalize:
api_field: imageImport.diskImageTargetDefaults.osAdaptationParameters.generalize
arg_name: generalize
type: bool
default: false
required: false
help_text: |
If true, generalize the imported image. Default false.
The generalization process enables co-existence of multiple VMs created from the same image.
For Windows, generalizing the image removes computer-specific information such as
installed drivers and the computer security identifier (SID).
description:
api_field: imageImport.diskImageTargetDefaults.description
arg_name: description
required: false
help_text: |
A description of the image.
family_name:
api_field: imageImport.diskImageTargetDefaults.familyName
arg_name: family-name
required: false
help_text: |
The name of the image family to which the new image belongs.
labels:
api_field: imageImport.diskImageTargetDefaults.labels.additionalProperties
arg_name: labels
required: false
metavar: KEY=VALUE
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
help_text: |
A map of labels to associate with the image.
additional_licenses:
api_field: imageImport.diskImageTargetDefaults.additionalLicenses
arg_name: additional-licenses
type: "googlecloudsdk.calliope.arg_parsers:ArgList:"
required: false
help_text: |
Comma-separated list of the additional licenses to assign to the image.
skip_os_adaptation:
api_field: imageImport.diskImageTargetDefaults.dataDiskImageImport
arg_name: skip-os-adaptation
type: bool
action: store_true
default: null
processor: googlecloudsdk.command_lib.migration.vms.image_import.hooks:GetDataDiskImageImportTransform
help_text: |
If true, skip OS adaptation. Default false.
guest_os_features:
api_field: imageImport.diskImageTargetDefaults.dataDiskImageImport.guestOsFeatures
arg_name: guest-os-features
type: "googlecloudsdk.calliope.arg_parsers:ArgList:"
required: false
help_text: |
Guest OS features to enable on the imported image.
This field does not change the OS of the image; it only marks the image with the specified features, so ensure they are compatible with the OS.
If specified, --skip-os-adaptation must be specified.
single_region_storage:
api_field: imageImport.diskImageTargetDefaults.singleRegionStorage
arg_name: single-region-storage
type: bool
default: false
help_text: |
If true, the location of the imported image will be the region of the import job. Otherwise the closest multi-region is selected. Default is false.
boot_conversion:
arg_name: boot-conversion
api_field: imageImport.diskImageTargetDefaults.osAdaptationParameters.bootConversion
required: false
help_text: |
This property will trigger an internal process which will convert the
image from using the existing boot option to another.
The size of the boot disk might be increased to allow the conversion.
Currently only support BIOS_TO_EFI.
adaptation_modifiers:
arg_name: adaptation-modifiers
processor: googlecloudsdk.command_lib.migration.vms.image_import.hooks:ProcessAdaptationModifiers
required: false
help_text: |
A map of flags to pass to the OS adaptation process.
The actual value depends on the modifier and can also be empty.
e.g. --adaptation-modifiers=flag1=value1,flag2
rootfs_uuid:
arg_name: rootfs-uuid
help_text: |
Identifies the file system to adapt.

View File

@@ -0,0 +1,26 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
source_file:
api_field: imageImport.cloudStorageUri
arg_name: source-file
required: true
help_text: |
The path to the Google Cloud Storage file from which the image should be imported.
kms_key:
arg_name: kms-key
# api_fields are set in the hook as this sets two different fields.
help_text: |
Fully qualified identifier for the Cloud KMS (Key Management Service) cryptokey that will be used to protect the image.

View File

@@ -0,0 +1,245 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Argument processors for disk/machine image import surface arguments."""
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.command_lib.migration.vms import hooks
# Argument Processors
def GetDataDiskImageImportTransform(value):
"""Returns empty DataDiskImageImport entry.
Args:
value: A pointer to the DataDiskImageImport field in the request.
Returns:
An empty DataDiskImageImport message.
"""
del value
return hooks.GetMessageClass('DataDiskImageImport')()
# Argument Processors
def GetSkipOsAdaptationTransform(value):
"""Returns empty SkipOsAdaptationTransform entry.
Args:
value: A pointer to the SkipOsAdaptation field in the request.
Returns:
An empty SkipOsAdaptation message.
"""
del value
return hooks.GetMessageClass('SkipOsAdaptation')()
def GetEncryptionTransform(value):
"""Returns empty Encryption entry.
Args:
value: A pointer to the Encryption field in the request.
Returns:
An empty Encryption message.
"""
del value
return hooks.GetMessageClass('Encryption')()
def GetProject(ref):
"""Returns the project name for the given resource reference.
Args:
ref: The resource reference.
Returns:
The project name for the given resource reference.
"""
return ref.Parent().Parent()
# Modify Request Hook For Disk Image Import
def FixCreateDiskImageImportRequest(ref, args, req):
"""Fixes the Create Image Import request for disk image import.
Args:
ref: The resource reference.
args: The parsed arguments.
req: The request message.
Returns:
The modified request message.
"""
if not (
args.generalize
or args.license_type
or args.boot_conversion
or args.adaptation_modifiers
or args.rootfs_uuid
):
req.imageImport.diskImageTargetDefaults.osAdaptationParameters = None
if not args.image_name:
req.imageImport.diskImageTargetDefaults.imageName = ref.Name()
if args.kms_key:
req.imageImport.diskImageTargetDefaults.encryption = (
GetEncryptionTransform(
req.imageImport.diskImageTargetDefaults.encryption
)
)
req.imageImport.diskImageTargetDefaults.encryption.kmsKey = args.kms_key
req.imageImport.encryption = (
GetEncryptionTransform(req.imageImport.encryption)
)
req.imageImport.encryption.kmsKey = args.kms_key
adaptation_modifiers = []
if args.adaptation_modifiers:
if not req.imageImport.diskImageTargetDefaults.osAdaptationParameters:
req.imageImport.diskImageTargetDefaults.osAdaptationParameters = (
hooks.GetMessageClass('ImageImportOsAdaptationParameters')()
)
adaptation_modifiers = ProcessAdaptationModifiers(args.adaptation_modifiers)
req.imageImport.diskImageTargetDefaults.osAdaptationParameters.adaptationModifiers = ProcessAdaptationModifiers(
args.adaptation_modifiers
)
if args.rootfs_uuid:
adaptation_modifiers.append(
hooks.GetMessageClass('AdaptationModifier')(
modifier='rootfs-uuid', value=args.rootfs_uuid
)
)
if adaptation_modifiers:
req.imageImport.diskImageTargetDefaults.osAdaptationParameters.adaptationModifiers = (
adaptation_modifiers
)
hooks.FixTargetDetailsCommonFields(
GetProject(ref), args, req.imageImport.diskImageTargetDefaults
)
return req
# Modify Request Hook For Machine Image Import
def FixCreateMachineImageImportRequest(ref, args, req):
"""Fixes the Create Image Import request machine image import.
Args:
ref: The resource reference.
args: The parsed arguments.
req: The request message.
Returns:
The modified request message.
"""
if not args.machine_image_name:
req.imageImport.machineImageTargetDefaults.machineImageName = ref.Name()
if (
not args.generalize
and not args.license_type
and not args.boot_conversion
and not args.adaptation_modifiers
and not args.rootfs_uuid
):
req.imageImport.machineImageTargetDefaults.osAdaptationParameters = None
if (
not args.secure_boot
and not args.enable_vtpm
and not args.enable_integrity_monitoring
):
req.imageImport.machineImageTargetDefaults.shieldedInstanceConfig = None
if args.kms_key:
req.imageImport.machineImageTargetDefaults.encryption = (
GetEncryptionTransform(
req.imageImport.machineImageTargetDefaults.encryption
)
)
req.imageImport.machineImageTargetDefaults.encryption.kmsKey = args.kms_key
req.imageImport.encryption = (
GetEncryptionTransform(req.imageImport.encryption)
)
req.imageImport.encryption.kmsKey = args.kms_key
adaptation_modifiers = []
if args.adaptation_modifiers:
if not req.imageImport.machineImageTargetDefaults.osAdaptationParameters:
req.imageImport.machineImageTargetDefaults.osAdaptationParameters = (
hooks.GetMessageClass('ImageImportOsAdaptationParameters')()
)
adaptation_modifiers = ProcessAdaptationModifiers(args.adaptation_modifiers)
if args.rootfs_uuid:
adaptation_modifiers.append(
hooks.GetMessageClass('AdaptationModifier')(
modifier='rootfs-uuid', value=args.rootfs_uuid
)
)
if adaptation_modifiers:
req.imageImport.machineImageTargetDefaults.osAdaptationParameters.adaptationModifiers = (
adaptation_modifiers
)
hooks.FixTargetDetailsCommonFields(
GetProject(ref), args, req.imageImport.machineImageTargetDefaults
)
return req
# convert the gcloud flags to the api format#
# i.e. --adaptation-modifiers=flag1,flag2=value2
# will be converted to:
# [AdaptationModifier{'modifier': 'flag1'},
# AdaptationModifier{'modifier': 'flag2', 'value': 'value2'}]
def ProcessAdaptationModifiers(adaptation_modifiers):
"""Processes the adaptation modifiers to match the API format.
Args:
adaptation_modifiers: A string or a list of strings representing the
adaptation flags.
Returns:
A list of dictionaries, where each dictionary represents a key-value
pair with 'key' and 'value' fields.
"""
if not adaptation_modifiers:
return []
if isinstance(adaptation_modifiers, str):
flags_list = adaptation_modifiers.split(',')
elif isinstance(adaptation_modifiers, list):
flags_list = adaptation_modifiers
else:
raise arg_parsers.ArgumentTypeError(
'adaptation-modifiers must be a string or a list of strings.'
)
result = []
for flag in flags_list:
if not flag:
continue
if '=' not in flag:
adaptation_flag_message = hooks.GetMessageClass('AdaptationModifier')(
modifier=flag.strip()
)
else:
key, value = flag.split('=', 1)
adaptation_flag_message = hooks.GetMessageClass('AdaptationModifier')(
modifier=key.strip(), value=value.strip()
)
result.append(adaptation_flag_message)
return result

View File

@@ -0,0 +1,193 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
machine_image_name:
api_field: imageImport.machineImageTargetDefaults.machineImageName
arg_name: machine-image-name
help_text: |
The name of the machine image that will be imported to Google Compute Engine.
Default is the Image Import name.
target_project:
api_field: imageImport.machineImageTargetDefaults.targetProject
arg_name: target-project
help_text: |
The target project resource path to which the machine image will be imported.
Default is the host project.
To get a list of the target projects run the gcloud alpha migration vms target-projects list command.
skip_os_adaptation:
api_field: imageImport.machineImageTargetDefaults.skipOsAdaptation
arg_name: skip-os-adaptation
type: bool
action: store_true
default: null
processor: googlecloudsdk.command_lib.migration.vms.image_import.hooks:GetSkipOsAdaptationTransform
help_text: |
If true, skip OS adaptation. Default false.
generalize:
api_field: imageImport.machineImageTargetDefaults.osAdaptationParameters.generalize
arg_name: generalize
type: bool
default: false
required: false
help_text: |
If true, generalize the imported machine image. Default false.
The generalization process enables co-existence of multiple VMs created from the same machine image.
For Windows, generalizing the machine image removes computer-specific information such as
installed drivers and the computer security identifier (SID).
license_type:
api_field: imageImport.machineImageTargetDefaults.osAdaptationParameters.licenseType
arg_name: license-type
required: false
help_text: |
The license to use post migration.
boot_conversion:
arg_name: boot-conversion
api_field: imageImport.machineImageTargetDefaults.osAdaptationParameters.bootConversion
required: false
help_text: |
This property will trigger an internal process which will convert the
image from using the existing boot option to another.
The size of the boot disk might be increased to allow the conversion.
Currently only support BIOS_TO_EFI.
adaptation_modifiers:
arg_name: adaptation-modifiers
processor: googlecloudsdk.command_lib.migration.vms.image_import.hooks:ProcessAdaptationModifiers
required: false
help_text: |
A map of flags to pass to the OS adaptation process.
The actual value depends on the modifier and can also be empty.
e.g. --adaptation-flags=flag1=value1,flag2
rootfs_uuid:
arg_name: rootfs-uuid
help_text: |
Identifies the file system to adapt.
description:
arg_name: description
required: false
help_text: |
A description of the machine image.
single_region_storage:
api_field: imageImport.machineImageTargetDefaults.singleRegionStorage
arg_name: single-region-storage
type: bool
default: false
help_text: |
If true, the location of the imported machine image will be the region of the import job. Otherwise the closest multi-region is selected. Default is false.
machine_type:
api_field: imageImport.machineImageTargetDefaults.machineImageParametersOverrides.machineType
arg_name: machine-type
required: false
help_text: |
The machine type to create the machine image with. If not provided, the service will choose a relevant machine type series based on the information from the source image.
service_account:
api_field: imageImport.machineImageTargetDefaults.serviceAccount.email
arg_name: service-account
required: false
help_text: |
The email address of the service account.
scopes:
api_field: imageImport.machineImageTargetDefaults.serviceAccount.scopes
arg_name: scopes
type: "googlecloudsdk.calliope.arg_parsers:ArgList:"
required: false
help_text: |
The list of scopes to be made available for the service account.
additional_licenses:
api_field: imageImport.machineImageTargetDefaults.additionalLicenses
arg_name: additional-licenses
type: "googlecloudsdk.calliope.arg_parsers:ArgList:"
required: false
help_text: |
Comma-separated list of the additional licenses to assign to the machine image.
labels:
api_field: imageImport.machineImageTargetDefaults.labels.additionalProperties
arg_name: labels
required: false
metavar: KEY=VALUE
type:
arg_dict:
flatten: true
spec:
- api_field: key
- api_field: value
help_text: |
A map of labels to associate with the machine image.
tags:
api_field: imageImport.machineImageTargetDefaults.tags
arg_name: tags
type: "googlecloudsdk.calliope.arg_parsers:ArgList:"
required: false
help_text: |
The tags to apply to the instance created by the machine image.
secure_boot:
api_field: imageImport.machineImageTargetDefaults.shieldedInstanceConfig.secureBoot
arg_name: secure-boot
required: false
help_text: |
Defines whether the instance created by the machine image has Secure Boot enabled. This can be set to true only if the image boot option is EFI. If not specified we will use the configuration of the source.
enable_vtpm:
api_field: imageImport.machineImageTargetDefaults.shieldedInstanceConfig.enableVtpm
arg_name: enable-vtpm
type: bool
action: store_true
required: false
help_text: |
Defines whether the instance created by the machine image has vTPM enabled. This can be set to true only if the image boot option is EFI.
enable_integrity_monitoring:
api_field: imageImport.machineImageTargetDefaults.shieldedInstanceConfig.enableIntegrityMonitoring
arg_name: enable-integrity-monitoring
type: bool
action: store_true
required: false
help_text: |
Defines whether the instance created by the machine image has integrity monitoring enabled. This can be set to true only if the image boot option is EFI, and vTPM is enabled.
network_interface:
api_field: imageImport.machineImageTargetDefaults.networkInterfaces
arg_name: network-interface
required: false
type:
arg_dict:
spec:
- api_field: network
required: false
- api_field: subnetwork
required: false
- api_field: networkTier
required: false
help_text: |
The network interface to use for the instance created by the machine image.
This is a dicionary with the following keys:
- network: The network to use for this network interface.
- subnetwork: The subnetwork to use for this network interface.
- network-tier: The network tier to use for this network interface.
This argument can be specified multiple times in case of multiple nics.

View File

@@ -0,0 +1,85 @@
project:
name: project
collection: vmmigration.projects
attributes:
- &project
parameter_name: projectsId
attribute_name: project
help: Project ID.
property: core/project
disable_auto_completers: false
location:
name: location
collection: vmmigration.projects.locations
attributes:
- *project
- &location
parameter_name: locationsId
attribute_name: location
help: Resource location.
property: compute/region
disable_auto_completers: false
locationDefaultGlobal:
name: location
collection: vmmigration.projects.locations
attributes:
- *project
- &locationDefaultGlobal
parameter_name: locationsId
attribute_name: location
help: Resource location.
fallthroughs:
- hook: googlecloudsdk.command_lib.migration.vms.hooks:SetLocationAsGlobal
hint: use global location
imageImport:
name: image_import
collection: vmmigration.projects.locations.imageImports
request_id_field: imageImportId
attributes:
- *project
- *location
- parameter_name: imageImportsId
attribute_name: image_import_name
help: The Image Import ID.
disable_auto_completers: false
targetProject:
name: target_project
collection: vmmigration.projects.locations.targetProjects
request_id_field: targetProjectId
attributes:
- *project
- *locationDefaultGlobal
- parameter_name: targetProjectsId
attribute_name: target_project
help: The target project ID.
disable_auto_completers: false
source:
name: source
collection: vmmigration.projects.locations.sources
attributes:
- *project
- *location
- &source
parameter_name: sourcesId
attribute_name: source
help: The client source environment object.
disable_auto_completers: false
diskMigration:
name: disk_migration
collection: vmmigration.projects.locations.sources.diskMigrationJobs
request_id_field: diskMigrationJobId
attributes:
- *project
- *location
- *source
- &diskMigration
parameter_name: diskMigrationJobsId
attribute_name: disk_migration
help: The Disk Migration ID.
disable_auto_completers: false