v1

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

Creates an instance resource in the specified project using the data included in the request.

post/projects/{project}/zones/{zone}/instances

Path parameters

projectstring required

Project ID for this request.

zonestring required

The name of the zone for this request.

Query parameters

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).

sourceInstanceTemplatestring

Specifies instance template to create the instance.

This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template:

  - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  - projects/project/global/instanceTemplates/instanceTemplate
  - global/instanceTemplates/instanceTemplate
sourceMachineImagestring

Specifies the machine image to use to create the instance.

This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to a machine image:

  - https://www.googleapis.com/compute/v1/projects/project/global/global/machineImages/machineImage
  - projects/project/global/global/machineImages/machineImage
  - global/machineImages/machineImage

Request body

startRestrictedboolean

Output only. [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity.

satisfiesPzsboolean

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

lastStopTimestampstring

Output only. [Output Only] Last stop timestamp inRFC3339 text format.

minCpuPlatformstring

Specifies aminimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge".

kindstring

Output only. [Output Only] Type of the resource. Always compute#instance for instances.

canIpForwardboolean

Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, seeEnabling IP Forwarding.

descriptionstring

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

labelsobject

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

labelFingerprintstring byte

A fingerprint for this request, which is essentially a hash of the label's contents and 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.

To see the latest fingerprint, make get() request to the instance.

fingerprintstring byte

Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance.

To see the latest fingerprint, make get() request to the instance.

lastStartTimestampstring

Output only. [Output Only] Last start timestamp inRFC3339 text format.

satisfiesPziboolean

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

machineTypestring

Full or partial URL of the machine type resource to use for this instance, in the format:zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type:

zones/us-central1-f/machineTypes/n1-standard-1

To create acustom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB):

zones/zone/machineTypes/custom-CPUS-MEMORY

For example: zones/us-central1-f/machineTypes/custom-4-5120 For a full list of restrictions, read theSpecifications for custom machine types.

sourceMachineImagestring

Source machine image

selfLinkstring

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

keyRevocationActionType'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED' | 'NONE' | 'STOP'

KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified.

status'DEPROVISIONING' | 'PENDING' | 'PROVISIONING' | 'REPAIRING' | 'RUNNING' | 'STAGING' | 'STOPPED' | 'STOPPING' | 'SUSPENDED' | 'SUSPENDING' | 'TERMINATED'

Output only. [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING,RUNNING, STOPPING, SUSPENDING,SUSPENDED, REPAIRING, andTERMINATED. For more information about the status of the instance, see Instance life cycle.

cpuPlatformstring

Output only. [Output Only] The CPU platform used by this instance.

deletionProtectionboolean

Whether the resource should be protected against deletion.

hostnamestring

Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS.

namestring

The name of the resource, provided by the client when initially creating the resource. The resource 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.

privateIpv6GoogleAccess'ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE' | 'ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE' | 'INHERIT_FROM_SUBNETWORK'

The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default.

creationTimestampstring

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

localSsdEncryptionMode'EPHEMERAL_KEY_ENCRYPTION' | 'LOCAL_SSD_ENCRYPTION_MODE_UNSPECIFIED' | 'STANDARD_ENCRYPTION'

Specifies which method should be used for encrypting the Local SSDs attached to the VM.

statusMessagestring

Output only. [Output Only] An optional, human-readable explanation of the status.

zonestring

Output only. [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.

resourcePoliciesstring[]

Resource policies applied to this instance.

lastSuspendedTimestampstring

Output only. [Output Only] Last suspended timestamp inRFC3339 text format.

idstring uint64

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

Response

Successful response