REST Resource: instances

Resource: Instance

Represents an Instance resource.

An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "tags": {
    "items": [
      string
    ],
    "fingerprint": string
  },
  "machineType": string,
  "status": enum,
  "statusMessage": string,
  "zone": string,
  "canIpForward": boolean,
  "networkInterfaces": [
    {
      "network": string,
      "subnetwork": string,
      "networkIP": string,
      "ipv6Address": string,
      "name": string,
      "accessConfigs": [
        {
          "type": enum,
          "name": string,
          "natIP": string,
          "externalIpv6": string,
          "externalIpv6PrefixLength": integer,
          "setPublicPtr": boolean,
          "publicPtrDomainName": string,
          "networkTier": enum,
          "kind": string
        }
      ],
      "ipv6AccessConfigs": [
        {
          "type": enum,
          "name": string,
          "natIP": string,
          "externalIpv6": string,
          "externalIpv6PrefixLength": integer,
          "setPublicPtr": boolean,
          "publicPtrDomainName": string,
          "networkTier": enum,
          "kind": string
        }
      ],
      "aliasIpRanges": [
        {
          "ipCidrRange": string,
          "subnetworkRangeName": string
        }
      ],
      "fingerprint": string,
      "stackType": enum,
      "ipv6AccessType": enum,
      "queueCount": integer,
      "nicType": enum,
      "kind": string
    }
  ],
  "disks": [
    {
      "type": enum,
      "mode": enum,
      "source": string,
      "deviceName": string,
      "index": integer,
      "boot": boolean,
      "initializeParams": {
        "diskName": string,
        "sourceImage": string,
        "diskSizeGb": string,
        "diskType": string,
        "sourceImageEncryptionKey": {
          "rawKey": string,
          "rsaEncryptedKey": string,
          "kmsKeyName": string,
          "sha256": string,
          "kmsKeyServiceAccount": string
        },
        "labels": {
          string: string,
          ...
        },
        "sourceSnapshot": string,
        "sourceSnapshotEncryptionKey": {
          "rawKey": string,
          "rsaEncryptedKey": string,
          "kmsKeyName": string,
          "sha256": string,
          "kmsKeyServiceAccount": string
        },
        "description": string,
        "guestOsFeatures": [
          {
            "type": enum
          }
        ],
        "resourcePolicies": [
          string
        ],
        "onUpdateAction": enum,
        "provisionedIops": string,
        "multiWriter": boolean
      },
      "autoDelete": boolean,
      "licenses": [
        string
      ],
      "interface": enum,
      "guestOsFeatures": [
        {
          "type": enum
        }
      ],
      "diskEncryptionKey": {
        "sha256": string,
        "kmsKeyServiceAccount": string,

        
        "rawKey": string,
        "rsaEncryptedKey": string,
        "kmsKeyName": string
        
      },
      "diskSizeGb": string,
      "shieldedInstanceInitialState": {
        "pk": {
          "content": string,
          "fileType": enum
        },
        "keks": [
          {
            "content": string,
            "fileType": enum
          }
        ],
        "dbs": [
          {
            "content": string,
            "fileType": enum
          }
        ],
        "dbxs": [
          {
            "content": string,
            "fileType": enum
          }
        ]
      },
      "userLicenses": [
        string
      ],
      "locked": boolean,
      "kind": string
    }
  ],
  "metadata": {
    "fingerprint": string,
    "items": [
      {
        "key": string,
        "value": string
      }
    ],
    "kind": string
  },
  "serviceAccounts": [
    {
      "email": string,
      "scopes": [
        string
      ]
    }
  ],
  "selfLink": string,
  "scheduling": {
    "onHostMaintenance": enum,
    "automaticRestart": boolean,
    "preemptible": boolean,
    "nodeAffinities": [
      {
        "key": string,
        "operator": enum,
        "values": [
          string
        ]
      }
    ],
    "minNodeCpus": integer,
    "locationHint": string,
    "maintenanceFreezeDurationHours": integer,
    "maintenanceInterval": enum,
    "provisioningModel": enum,
    "instanceTerminationAction": enum,
    "hostErrorTimeoutSeconds": integer
  },
  "cpuPlatform": string,
  "labels": {
    string: string,
    ...
  },
  "labelFingerprint": string,
  "minCpuPlatform": string,
  "guestAccelerators": [
    {
      "acceleratorType": string,
      "acceleratorCount": integer
    }
  ],
  "startRestricted": boolean,
  "deletionProtection": boolean,
  "resourcePolicies": [
    string
  ],
  "sourceMachineImage": string,
  "shieldedVmConfig": {
    "enableSecureBoot": boolean,
    "enableVtpm": boolean,
    "enableIntegrityMonitoring": boolean
  },
  "shieldedVmIntegrityPolicy": {
    "updateAutoLearnPolicy": boolean
  },
  "reservationAffinity": {
    "consumeReservationType": enum,
    "key": string,
    "values": [
      string
    ]
  },
  "hostname": string,
  "displayDevice": {
    "enableDisplay": boolean
  },
  "shieldedInstanceConfig": {
    "enableSecureBoot": boolean,
    "enableVtpm": boolean,
    "enableIntegrityMonitoring": boolean
  },
  "shieldedInstanceIntegrityPolicy": {
    "updateAutoLearnPolicy": boolean
  },
  "sourceMachineImageEncryptionKey": {
    "rawKey": string,
    "rsaEncryptedKey": string,
    "kmsKeyName": string,
    "sha256": string,
    "kmsKeyServiceAccount": string
  },
  "eraseWindowsVssSignature": boolean,
  "postKeyRevocationActionType": enum,
  "confidentialInstanceConfig": {
    "enableConfidentialCompute": boolean
  },
  "fingerprint": string,
  "privateIpv6GoogleAccess": enum,
  "advancedMachineFeatures": {
    "enableNestedVirtualization": boolean,
    "threadsPerCore": integer
  },
  "lastStartTimestamp": string,
  "lastStopTimestamp": string,
  "lastSuspendedTimestamp": string,
  "satisfiesPzs": boolean,
  "networkPerformanceConfig": {
    "totalEgressBandwidthTier": enum
  },
  "kind": string
}
Fields
id

string (uint64 format)

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

creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

name

string

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 with RFC1035. 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.

description

string

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

tags

object

Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. Multiple tags can be specified via the 'tags.items' field.

tags.items[]

string

An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035.

tags.fingerprint

string (bytes format)

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

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

A base64-encoded string.

machineType

string

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 a custom 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 the Specifications for custom machine types.

status

enum

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

statusMessage

string

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

zone

string

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

canIpForward

boolean

Allows this instance to send and receive packets with non-matching destination or sourc