v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-131,0021,0174.3 MB
images

Creates an image in the specified project using the data included in the request.

post/projects/{project}/global/images

Path parameters

projectstring required

Project ID for this request.

Query parameters

forceCreateboolean

Force image creation if true.

requestIdstring

An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.

For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Request body

creationTimestampstring

Output only. [Output Only] Creation timestamp inRFC3339 text format.

licenseCodesstring[]

Integer license codes indicating which licenses are attached to this image.

namestring

Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

diskSizeGbstring int64

Size of the image when restored onto a persistent disk (in GB).

enableConfidentialComputeboolean

Output only. Whether this image is created from a confidential compute mode disk. [Output Only]: This field is not set by user, but from source disk.

archiveSizeBytesstring int64

Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).

idstring uint64

Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.

sourceDiskstring

URL of the source disk used to create this image. For example, the following are valid values:

In order to create an image, you must provide the full or partial URL of one of the following:

  • The rawDisk.source URL
  • The sourceDisk URL
  • The sourceImage URL
  • The sourceSnapshot URL
licensesstring[]

Any applicable license URI.

architecture'ARCHITECTURE_UNSPECIFIED' | 'ARM64' | 'X86_64'

The architecture of the image. Valid values are ARM64 or X86_64.

descriptionstring

An optional description of this resource. Provide this property when you create the resource.

labelFingerprintstring byte

A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error412 conditionNotMet.

To see the latest fingerprint, make a get() request to retrieve an image.

sourceSnapshotIdstring

Output only. [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name.

satisfiesPziboolean

Output only. Reserved for future use.

labelsobject

Labels to apply to this image. These can be later modified by the setLabels method.

familystring

The name of the image family to which this image belongs. The image family name can be from a publicly managed image family provided by Compute Engine, or from a custom image family you create. For example,centos-stream-9 is a publicly available image family. For more information, see Image family best practices.

When creating disks, you can specify an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.

sourceImagestring

URL of the source image used to create this image. The following are valid formats for the URL:

In order to create an image, you must provide the full or partial URL of one of the following:

  • The rawDisk.source URL
  • The sourceDisk URL
  • The sourceImage URL
  • The sourceSnapshot URL
satisfiesPzsboolean

Output only. [Output Only] Reserved for future use.

sourceImageIdstring

Output only. [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name.

kindstring

Output only. [Output Only] Type of the resource. Always compute#image for images.

sourceDiskIdstring

Output only. [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.

status'DELETING' | 'FAILED' | 'PENDING' | 'READY'

Output only. [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, orREADY.

storageLocationsstring[]

Cloud Storage bucket storage location of the image (regional or multi-regional).

selfLinkstring

Output only. [Output Only] Server-defined URL for the resource.

sourceType'RAW'

The type of the image used to create this disk. The default and only valid value is RAW.

sourceSnapshotstring

URL of the source snapshot used to create this image. The following are valid formats for the URL:

In order to create an image, you must provide the full or partial URL of one of the following:

  • The rawDisk.source URL
  • The sourceDisk URL
  • The sourceImage URL
  • The sourceSnapshot URL

Response

Successful response