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,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2023 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.
"""The command group for Migrate to Virtual Machines service."""
from googlecloudsdk.calliope import base
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.GA, base.ReleaseTrack.ALPHA)
class Vms(base.Group):
"""Provides Migrate to Virtual Machines (VM migration) service functionality.
The gcloud alpha migration vms command group provides the CLI for
the Migrate to Virtual Machines API.
Google Cloud Migrate to Virtual Machines migrates VMs from on-premises data
center and other cloud providers to Google Compute Engine virtual machine (VM)
instances.
VM Migration API must be enabled in your project.
"""

View File

@@ -0,0 +1,59 @@
# -*- 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.
"""The command group for Disk Migrations."""
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.DefaultUniverseOnly
class DiskMigrations(base.Group):
r"""Migrates disks to Compute Engine.
The gcloud alpha migration vms disk-migrations command lets you create and
manage disk migration resource. You must create a disk migration resource
before you can migrate your disk from any migration source to a Compute Engine
disk. The disk migration resource tracks the progress of the disk migration.
To use this command, you must enable VM Migration API in your project.
Note that this command only creates a disk migration resource. It does not
initiate the disk migration process. After creating the disk migration
resource, you must initiate the migration process using the run command.
The disk is migrated to a Google Cloud Project, designated by the Target Project resource.
To get a list of Target Projects, run the gcloud alpha migration vms target-projects list command.
For information on adding target projects, see https://cloud.google.com/migrate/virtual-machines/docs/5.0/how-to/target-project.
A project can support a maximum of 200 Disk/VM Migration active resources per project; 1000 ready disk migration resources, and 500 finished disk migration resources.
Hence we recommend that you delete a completed disk migrations to avoid reaching the disk migration resources limit.
Deletion of disk migration resource does not affect the migrated disk.
## Create Disk Migration
$ gcloud migration vms disk-migrations create DISK_MIGRATION_JOB_NAME \
--source=AWS_SOURCE_NAME \
--source-volume-id=AWS_VOLUME_ID \
--location=REGION \
--target-project=TARGET_PROJECT_RESOURCE_PATH
## Run Disk Migration
$ gcloud migration vms disk-migrations run DISK_MIGRATION_JOB_NAME \
--source=AWS_SOURCE_NAME \
--location=REGION \
## Delete Disk Migration resource
$ gcloud migration vms disk-migrations delete DISK_MIGRATION_JOB_NAME \
--location=REGION
"""

View File

@@ -0,0 +1,20 @@
- release_tracks: [ALPHA]
help_text:
brief: Cancel a disk migration resource process.
description: |
{command} cancels an ongoing disk migration resource process.
To use this command, you must enable VM Migration API in your project.
examples: |
To cancel an ongoing my-disk-migration resource process in us-central1 in the AWS source
my-aws-source in the default project, run:
$ {command} my-disk-migration --location=us-central1 --source=my-aws-source
request:
method: cancel
collection: vmmigration.projects.locations.sources.diskMigrationJobs
arguments:
resource:
help_text: The disk migration resource you want to cancel its ongoing process.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:diskMigration

View File

@@ -0,0 +1,61 @@
- release_tracks: [ALPHA]
help_text:
brief: Create a disk migration resource to migrate a disk to Compute Engine.
description: |
{command} lets you create disk migration resource. You must create a disk migration resource
before you can migrate your disk from any migration source to a Compute Engine disk. The disk
migration resource tracks the progress of the disk migration.
To use this command, you must enable VM Migration API in your project.
Note that this command only creates a disk migration resource. It does not initiate the disk
migration process. After creating the disk migration resource, you must initiate the
migration process using the run command.
examples: |
To create a disk migration resource to migrate a volume vol-12345 from an AWS source
my-aws-source to my-target-project in us-central1, create the my-disk-migration disk migration
resource in my-project in us-central1, run:
$ {command} my-disk-migration \
--project=my-project \
--location=us-central1 \
--source=my-aws-source \
--source-volume-id=vol-12345 \
--disk-id=gcp-disk1 \
--target-project=projects/my-project/locations/global/targetProjects/my-target-project
request:
collection: vmmigration.projects.locations.sources.diskMigrationJobs
modify_request_hooks:
- googlecloudsdk.command_lib.migration.vms.disk_migration.hooks:FixCreateDiskMigrationsRequest
arguments:
resource:
help_text: The disk migration resource you want to create. This would be the disk ID if --disk-id is not given.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:diskMigration
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:source_volume_id
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:labels
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:target_project
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:kms_key
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:disk_id
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:zone
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:disk_type
choices:
- arg_value: compute-engine-disk-type-standard
enum_value: COMPUTE_ENGINE_DISK_TYPE_STANDARD
help_text: |-
Compute Engine Disk Type Standard.
- arg_value: compute-engine-disk-type-ssd
enum_value: COMPUTE_ENGINE_DISK_TYPE_SSD
help_text: |-
Compute Engine Disk Type SSD.
- arg_value: compute-engine-disk-type-balanced
enum_value: COMPUTE_ENGINE_DISK_TYPE_BALANCED
help_text: |-
Compute Engine Disk Type Balanced.
- arg_value: compute-engine-disk-type-hyperdisk-balanced
enum_value: COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED
help_text: |-
Compute Engine Disk Type hyperdisk-balanced.

View File

@@ -0,0 +1,22 @@
- release_tracks: [ALPHA]
help_text:
brief: Delete a disk migration resource.
description: |
{command} deletes a disk migration resource.
To use this command, you must enable VM Migration API in your project.
This command does not delete any disks on Google Compute Engine.
examples: |
To delete my-disk-migration resource in us-central1 in the AWS source my-aws-source in the
default project, run:
$ {command} my-image-import --location=us-central1 --source=my-aws-source
request:
collection: vmmigration.projects.locations.sources.diskMigrationJobs
arguments:
resource:
help_text: The disk migration resource you want to delete.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:diskMigration

View File

@@ -0,0 +1,21 @@
- release_tracks: [ALPHA]
help_text:
brief: Describe a disk migration resource.
description: |
{command} describes a disk migration resource.
The disk migration resource tracks the disk migration progress.
To use this command, you must enable VM Migration API in your project.
examples: |
To describe my-disk-migration resource in us-central1 in the AWS source my-aws-source in the
default project, run:
$ {command} my-disk-migration --location=us-central1 --source=my-aws-source
request:
collection: vmmigration.projects.locations.sources.diskMigrationJobs
arguments:
resource:
help_text: The disk migration resource you want to describe.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:diskMigration

View File

@@ -0,0 +1,32 @@
- release_tracks: [ALPHA]
help_text:
brief: Lists source environment volume inventory.
description: |
{command} prints a detailed list of the source environment volume inventory.
To use this command, you must enable VM Migration API in your project.
examples: |
To list the source environment volume resources in us-central1 in the AWS source my-aws-source in the
default project, run:
$ {command} my-aws-source --location=us-central1
request:
method: fetchStorageInventory
collection: vmmigration.projects.locations.sources
static_fields:
type: DISKS
response:
id_field: awsDiskDetails
arguments:
resource:
help_text: |
The source environment resource of the disk migration resources.
This is the parent resource of the disk migration resources.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:source
# is_primary_resource: true
output:
format: table(awsDiskDetails.volumeId, awsDiskDetails.sizeGib, awsDiskDetails.diskType, awsDiskDetails.tags)

View File

@@ -0,0 +1,28 @@
- release_tracks: [ALPHA]
help_text:
brief: List disk migration resources.
description: |
{command} prints a detailed list of disk migration resources.
To use this command, you must enable VM Migration API in your project.
examples: |
To list the disk migration resources in us-central1 in the AWS source my-aws-source in the
default project, run:
$ {command} --location=us-central1 --source=my-aws-source
request:
collection: vmmigration.projects.locations.sources.diskMigrationJobs
response:
id_field: name
arguments:
resource:
help_text: |
The source environment resource of the disk migration resources.
This is the parent resource of the disk migration resources.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:source
output:
format: table(name.basename(), state, awsSourceDiskDetails.volumeId, targetDetails.targetProject.basename(), targetDetails.targetDisk.zone, targetDetails.targetDisk.diskId, targetDetails.targetDisk.diskType, createTime)

View File

@@ -0,0 +1,19 @@
- release_tracks: [ALPHA]
help_text:
brief: Run a disk migration resource process.
description: |
{command} initiates a disk migration resource process.
To use this command, you must enable VM Migration API in your project.
examples: |
To run my-disk-migration resource process in us-central1 in the AWS source my-aws-source in the default project, run:
$ {command} my-disk-migration --location=us-central1 --source=my-aws-source
request:
method: run
collection: vmmigration.projects.locations.sources.diskMigrationJobs
arguments:
resource:
help_text: The disk migration resource you want to initiate its process.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:diskMigration

View File

@@ -0,0 +1,49 @@
- release_tracks: [ALPHA]
help_text:
brief: Update a disk migration resource target details.
description: |
{command} updates a disk migration resource.
To use this command, you must enable VM Migration API in your project.
examples: |
To update a disk migration resource my-disk-migration from AWS source
my-aws-source disk type to pd-ssd, run:
$ {command} my-disk-migration \
--project=my-project \
--location=us-central1 \
--source=my-aws-source \
--disk-type=COMPUTE_ENGINE_DISK_TYPE_SSD
request:
collection: vmmigration.projects.locations.sources.diskMigrationJobs
arguments:
resource:
help_text: The disk migration resource you want to udpate.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:diskMigration
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:labels
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:target_project
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:kms_key
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:disk_id
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:zone
- _REF_: googlecloudsdk.command_lib.migration.vms.disk_migration.flags:disk_type
choices:
- arg_value: compute-engine-disk-type-standard
enum_value: COMPUTE_ENGINE_DISK_TYPE_STANDARD
help_text: |-
Compute Engine Disk Type Standard.
- arg_value: compute-engine-disk-type-ssd
enum_value: COMPUTE_ENGINE_DISK_TYPE_SSD
help_text: |-
Compute Engine Disk Type SSD.
- arg_value: compute-engine-disk-type-balanced
enum_value: COMPUTE_ENGINE_DISK_TYPE_BALANCED
help_text: |-
Compute Engine Disk Type Balanced.
- arg_value: compute-engine-disk-type-hyperdisk-balanced
enum_value: COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED
help_text: |-
Compute Engine Disk Type hyperdisk-balanced.

View File

@@ -0,0 +1,62 @@
# -*- coding: utf-8 -*- #
# Copyright 2023 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.
"""The command group for Image Imports."""
from googlecloudsdk.calliope import base
# We could have multiple tracks here, e.g.
@base.DefaultUniverseOnly
@base.ReleaseTracks(base.ReleaseTrack.GA, base.ReleaseTrack.ALPHA)
class ImageImports(base.Group):
r"""Imports images to Google Compute Engine from Google Cloud Storage.
gcloud alpha migration vms image-imports provides a more robust and better
supported method for importing images to Google Compute Engine.
Other image-related operations (for example, list) can be done using
gcloud compute images, as usual.
The commands use VM Migartion API which supports importing of an image from
a Google Cloud Storage file (gs://...) to a target project.
VM Migration API must be enabled in your project.
gcloud alpha migration vms image-imports create creates an Image Import resource
with a nested Image Import Job resource. The Image Import Job resource tracks
the image import progress. After the Image Import Job completes, successfully
or otherwise, there's no further use for the Image Import resource.
The image is imported to a Google Cloud Project, desginated by the
Target Project resource. To get a list of Target Projects, run the
gcloud alpha migration vms target-projects list command.
Use the Google Cloud console to add target project resources.
For information on adding target projects, see
https://cloud.google.com/migrate/virtual-machines/docs/5.0/how-to/target-project.
A project can support a maximum of 1000 Image Import resources per project.
Hence it's recommended to delete an Image Import resource after the Image
Import Job is complete to avoid reaching the Image Import resources limit.
Deletion of Image Import resource does not affect the imported image.
## Import Image
$ gcloud alpha migration vms image-imports create IMAGE_IMPORT_NAME \
--source-file=GCS_FILE_NAME \
--image-name=IMPORTED_IMAGE_NAME \
--location=REGION \
--target-project=TARGET_PROJECT_RESOURCE_PATH
## Delete Image Import resource
$ gcloud alpha migration vms image-imports delete IMAGE_IMPORT_NAME \
--location=REGION
"""

View File

@@ -0,0 +1,59 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: import Virtual Disk images to Google Compute Engine.
description: |
{command} imports images such as VMWare VMDK files and VHD files, from a Google Cloud Storage
file (gs://...) to Google Compute Engine, using the Migrate to Virtual Machines service API.
This command creates an Image Import resource with a nested Image Import Job
resource. The Image Import Job resource tracks the image import progress.
To use this command, you must enable VM Migration API in your project.
examples: |
To import my-ubuntu22.04.vmdk from my-images-bucket to my-target-project in us-central1,
create my-image-import resource in my-project in us-central1.
Run:
$ {command} my-image-import \
--source-file=gs://my-images-bucket/my-ubuntu22.04.vmdk \
--image-name=my-ubuntu-image \
--location=us-central1 \
--target-project=projects/my-project/locations/global/targetProjects/my-target-project
--project=my-project
request:
collection: vmmigration.projects.locations.imageImports
modify_request_hooks:
- googlecloudsdk.command_lib.migration.vms.image_import.hooks:FixCreateDiskImageImportRequest
arguments:
resource:
help_text: The Image Import resource you want to create. This would be the image name if --image-name is not given.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:imageImport
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.flags:source_file
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:image_name
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:target_project
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:description
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:family_name
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:labels
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:additional_licenses
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:single_region_storage
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.flags:kms_key
- group:
help_text: OS adaptation parameters
required: false
mutex: true
params:
- group:
params:
- group:
required: true
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:skip_os_adaptation
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:guest_os_features
- group:
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:generalize
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:license_type
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:boot_conversion
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:adaptation_modifiers
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:rootfs_uuid

View File

@@ -0,0 +1,19 @@
- help_text:
brief: delete an Image Import resource.
description: |
{command} deletes an Image Import resource.
To use this command, you must enable VM Migration API in your project.
This command does not delete any images imported to Google Compute Engine.
examples: |
To delete my-image-import resource in us-central1 in the default project, run:
$ {command} my-image-import --location=us-central1
request:
collection: vmmigration.projects.locations.imageImports
arguments:
resource:
help_text: The Image Import resource you want to delete.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:imageImport

View File

@@ -0,0 +1,18 @@
- help_text:
brief: describe an Image Import.
description: |
{command} describes an Image Import resource with a nested Image Import Job.
The Image Import Job resource tracks the image import progress.
To use this command, you must enable VM Migration API in your project.
examples: |
To describe my-image-import resource in us-central1 in the default project, run:
$ {command} my-image-import --location=us-central1
request:
collection: vmmigration.projects.locations.imageImports
arguments:
resource:
help_text: The Image Import you want to describe.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:imageImport

View File

@@ -0,0 +1,27 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: list Image Imports.
description: |
{command} prints a detailed list of Image Import resources.
To use this command, you must enable VM Migration API in your project.
examples: |
To list the Image Import resources in us-central1 in the default project, run:
$ {command} --location=us-central1
request:
collection: vmmigration.projects.locations.imageImports
response:
id_field: name
arguments:
resource:
help_text: |
The compute/region of the Image Import.
To get a list of the available regions, run gcloud compute regions list command.
If not specified, the value of the [compute/zone] property in the current gcloud configuration is used.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:location
output:
format: table(name.basename(), recentImageImportJobs[0].state, cloudStorageUri, diskImageTargetDefaults.imageName, diskImageTargetDefaults.targetProject.basename(), createTime)

View File

@@ -0,0 +1,63 @@
# -*- coding: utf-8 -*- #
# Copyright 2024 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.
"""The command group for Machine Image Imports."""
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.GA, base.ReleaseTrack.ALPHA)
@base.DefaultUniverseOnly
class MachineImageImports(base.Group):
r"""Imports machine images to Google Compute Engine from Google Cloud Storage.
gcloud migration vms machine-image-imports provides a more robust and better
supported method for importing machine images to Google Compute Engine.
Other image-related operations (for example, list) can be done using
gcloud compute images, as usual.
The commands use VM Migration API which supports importing of a machine image from
a Google Cloud Storage file (gs://...) to a target project.
VM Migration API must be enabled in your project.
`gcloud migration vms machine-image-imports create` creates a machine Image Import resource
with a nested Image Import Job resource. The Image Import Job resource tracks
the machine image import progress. After the Image Import Job completes, successfully
or otherwise, there's no further use for the Image Import resource.
The machine image is imported to a Google Cloud Project, desginated by the
Target Project resource. To get a list of Target Projects, run the
gcloud alpha migration vms target-projects list command.
Use the Google Cloud console to add target project resources.
For information on adding target projects, see
https://cloud.google.com/migrate/virtual-machines/docs/5.0/how-to/target-project.
A project can support up to a certain number of Image Import resources per project.
Hence it's recommended to delete an Image Import resource after the Image
Import Job is complete to avoid reaching the Image Import resources limit.
Deletion of Image Import resource does not affect the imported machine image.
For more information about the image import resource, see
https://cloud.google.com/migrate/virtual-machines/docs/5.0/migrate/image_import.
## Import Image
$ gcloud migration vms machine-image-imports create MACHINE_IMAGE_IMPORT_NAME \
--source-file=GCS_FILE_NAME \
--image-name=IMPORTED_IMAGE_NAME \
--location=REGION \
--target-project=TARGET_PROJECT_RESOURCE_PATH
## Delete Image Import resource
$ gcloud migration vms machine-image-imports delete MACHINE_IMAGE_IMPORT_NAME \
--location=REGION
"""

View File

@@ -0,0 +1,69 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: import machine images to Google Compute Engine.
description: |
{command} Imports machine images such as OVA and OVF files, from a Google Cloud Storage file
(gs://...) to Google Compute Engine, using the Migrate to Virtual Machines service API.
This command creates an Image Import resource with a nested Image Import Job resource.
The Image Import Job resource tracks the image import progress. To use this command, you
must enable VM Migration API in your project.
examples: |
To import ub-14.04.5.ova from my-images-bucket to my-target-project in us-central1,
create my-image-import resource in my-project in us-central1.
Run:
$ {command} my-machine-image-import \
--source-file=gs://my-images-bucket/ub-14.04.5.ova \
--image-name=my-ubuntu-machine-image \
--location=us-central1 \
--target-project=projects/my-project/locations/global/targetProjects/my-target-project
--project=my-project
request:
collection: vmmigration.projects.locations.imageImports
modify_request_hooks:
- googlecloudsdk.command_lib.migration.vms.image_import.hooks:FixCreateMachineImageImportRequest
arguments:
resource:
help_text: The Image Import resource you want to create. This would be the machine image name if --machine-image-name is not given.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:imageImport
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.flags:source_file
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:machine_image_name
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:target_project
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.flags:kms_key
- group:
help_text: OS adaptation parameters.
required: false
mutex: true
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:skip_os_adaptation
- group:
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:generalize
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:license_type
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:boot_conversion
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:adaptation_modifiers
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.disk_image_import.flags:rootfs_uuid
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:description
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:single_region_storage
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:machine_type
- group:
help_text: The service account to assign to the instance created by the machine image.
required: false
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:service_account
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:scopes
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:additional_licenses
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:labels
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:tags
- group:
help_text: Shielded instance configuration.
required: false
params:
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:secure_boot
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:enable_vtpm
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:enable_integrity_monitoring
- _REF_: googlecloudsdk.command_lib.migration.vms.image_import.machine_image_import.flags:network_interface

View File

@@ -0,0 +1,19 @@
- help_text:
brief: delete an Image Import resource.
description: |
{command} deletes an Image Import resource.
To use this command, you must enable VM Migration API in your project.
This command does not delete any machine images imported to Google Compute Engine.
examples: |
To delete my-image-import resource in us-central1 in the default project, run:
$ {command} my-image-import --location=us-central1
request:
collection: vmmigration.projects.locations.imageImports
arguments:
resource:
help_text: The Image Import resource you want to delete.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:imageImport

View File

@@ -0,0 +1,18 @@
- help_text:
brief: describe an Image Import.
description: |
{command} describes an Image Import resource with a nested Image Import Job.
The Image Import Job resource tracks the image import progress.
To use this command, you must enable VM Migration API in your project.
examples: |
To describe my-image-import resource in us-central1 in the default project, run:
$ {command} my-image-import --location=us-central1
request:
collection: vmmigration.projects.locations.imageImports
arguments:
resource:
help_text: The Image Import you want to describe.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:imageImport

View File

@@ -0,0 +1,27 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: list Image Imports.
description: |
{command} prints a detailed list of Image Import resources.
To use this command, you must enable VM Migration API in your project.
examples: |
To list the Image Import resources in us-central1 in the default project, run:
$ {command} --location=us-central1
request:
collection: vmmigration.projects.locations.imageImports
response:
id_field: name
arguments:
resource:
help_text: |
The compute/region of the Image Import.
To get a list of the available regions, run gcloud compute regions list command.
If not specified, the value of the [compute/zone] property in the current gcloud configuration is used.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:location
output:
format: table(name.basename(), recentImageImportJobs[0].state, cloudStorageUri, machineImageTargetDefaults.machineImageName, machineImageTargetDefaults.targetProject.basename(), createTime)

View File

@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*- #
# Copyright 2023 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.
"""The command group for Target Projects."""
from googlecloudsdk.calliope import base
# We could have multiple tracks here, e.g.
# @base.ReleaseTracks(base.ReleaseTrack.GA, base.ReleaseTrack.ALPHA)
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.GA)
@base.DefaultUniverseOnly
class TargetProjects(base.Group):
"""Manage Target Projects.
target-projects sub-group is used to manage Target Project resources of the
Migrate to Virtual Machines service.
Target projects are defined for each customer project in the global location.
A Target Project could be used as the target project of various migration
commands.
VM Migration API must be enabled in your project.
## List Target Projects
gcloud alpha migration vms target-projects list
"""

View File

@@ -0,0 +1,31 @@
- release_tracks: [ALPHA, GA]
help_text:
brief: list Target Projects.
description: |
{command} lists Target Project resources, which are required for setting the target project for migration.
Target projects are defined for each customer project in the global location.
To use this command, you must enable VM Migration API in your project.
examples: |
To list the Target Project resources in the global location in the default project, run:
$ {command}
request:
collection: vmmigration.projects.locations.targetProjects
response:
id_field: name
arguments:
resource:
help_text: |
The compute/region of the Image Import.
To get a list of the available regions, run gcloud compute regions list command.
If not specified, the value of the [compute/zone] property in the current gcloud configuration is used.
spec: !REF googlecloudsdk.command_lib.migration.vms.resources:locationDefaultGlobal
removed_flags: [location]
output:
format: table(name, project, createTime)