instances

GET /projects/{project}/zones/{zone}/instances/{instance}

Changed on

Returns the specified Instance resource.

Request

  • Base URL
    https://compute.googleapis.com/compute/v1
  • URL
    https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{instance}
  • Auth
    • OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/cloud-platform
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/cloud-platform
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/compute
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/compute
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/compute.readonly
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/compute.readonly

Path parameters

projectstring required

Project ID for this request.

zonestring required

The name of the zone for this request.

instancestring required

Name of the instance resource to return.

Response

Successful response

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.

cpuPlatformstring

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

creationTimestampstring

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

deletionProtectionboolean

Whether the resource should be protected against deletion.

descriptionstring

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

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.

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.

idstring uint64

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

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.

kindstring

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

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.

labelsobject

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

lastStartTimestampstring

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

lastStopTimestampstring

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

lastSuspendedTimestampstring

Output only. [Output Only] Last suspended 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.

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.

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

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.

resourcePoliciesstring[]

Resource policies applied to this instance.

satisfiesPziboolean

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

satisfiesPzsboolean

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

selfLinkstring

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

sourceMachineImagestring

Source machine image

startRestrictedboolean

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

status'DEPROVISIONING' | 'PENDING' | 'PENDING_STOP' | '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.

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.

Changes

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/compute.readonly was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/compute.readonly was removed from the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/compute.readonly was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/compute.readonly was removed from the endpoint's security scheme Oauth2c