Skip to main content

image_imports

Creates, updates, deletes, gets or lists a image_imports resource.

Overview

Nameimage_imports
TypeResource
Idgoogle.vmmigration.image_imports

Fields

NameDatatypeDescription
namestringOutput only. The resource path of the ImageImport.
cloudStorageUristringImmutable. The path to the Cloud Storage file from which the image should be imported.
createTimestringOutput only. The time the image import was created.
diskImageTargetDefaultsobjectThe target details of the image resource that will be created by the import job.
encryptionobjectEncryption message describes the details of the applied encryption.
machineImageTargetDefaultsobjectThe target details of the machine image resource that will be created by the image import job.
recentImageImportJobsarrayOutput only. The result of the most recent runs for this ImageImport. All jobs for this ImageImport can be listed via ListImageImportJobs.

Methods

NameAccessible byRequired ParamsDescription
getSELECTimageImportsId, locationsId, projectsIdGets details of a single ImageImport.
listSELECTlocationsId, projectsIdLists ImageImports in a given project.
createINSERTlocationsId, projectsIdCreates a new ImageImport in a given project.
deleteDELETEimageImportsId, locationsId, projectsIdDeletes a single ImageImport.

SELECT examples

Lists ImageImports in a given project.

SELECT
name,
cloudStorageUri,
createTime,
diskImageTargetDefaults,
encryption,
machineImageTargetDefaults,
recentImageImportJobs
FROM google.vmmigration.image_imports
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new image_imports resource.

/*+ create */
INSERT INTO google.vmmigration.image_imports (
locationsId,
projectsId,
cloudStorageUri,
diskImageTargetDefaults,
machineImageTargetDefaults,
encryption
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ cloudStorageUri }}',
'{{ diskImageTargetDefaults }}',
'{{ machineImageTargetDefaults }}',
'{{ encryption }}'
;

DELETE example

Deletes the specified image_imports resource.

/*+ delete */
DELETE FROM google.vmmigration.image_imports
WHERE imageImportsId = '{{ imageImportsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';