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
{
  "kind": string,
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "tags": {
    object (Tags)
  },
  "machineType": string,
  "status": enum (Status),
  "statusMessage": string,
  "zone": string,
  "canIpForward": boolean,
  "networkInterfaces": [
    {
      object (NetworkInterface)
    }
  ],
  "disks": [
    {
      object (AttachedDisk)
    }
  ],
  "metadata": {
    object (Metadata)
  },
  "serviceAccounts": [
    {
      object (ServiceAccount)
    }
  ],
  "selfLink": string,
  "scheduling": {
    object (Scheduling)
  },
  "cpuPlatform": string,
  "labels": {
    string: string,
    ...
  },
  "params": {
    object (InstanceParams)
  },
  "labelFingerprint": string,
  "instanceEncryptionKey": {
    object (CustomerEncryptionKey)
  },
  "minCpuPlatform": string,
  "guestAccelerators": [
    {
      object (AcceleratorConfig)
    }
  ],
  "startRestricted": boolean,
  "deletionProtection": boolean,
  "resourcePolicies": [
    string
  ],
  "sourceMachineImage": string,
  "reservationAffinity": {
    object (ReservationAffinity)
  },
  "hostname": string,
  "displayDevice": {
    object (DisplayDevice)
  },
  "shieldedInstanceConfig": {
    object (ShieldedInstanceConfig)
  },
  "shieldedInstanceIntegrityPolicy": {
    object (ShieldedInstanceIntegrityPolicy)
  },
  "sourceMachineImageEncryptionKey": {
    object (CustomerEncryptionKey)
  },
  "confidentialInstanceConfig": {
    object (ConfidentialInstanceConfig)
  },
  "fingerprint": string,
  "privateIpv6GoogleAccess": enum (InstancePrivateIpv6GoogleAccess),
  "advancedMachineFeatures": {
    object (AdvancedMachineFeatures)
  },
  "lastStartTimestamp": string,
  "lastStopTimestamp": string,
  "lastSuspendedTimestamp": string,
  "satisfiesPzs": boolean,
  "satisfiesPzi": boolean,
  "resourceStatus": {
    object (ResourceStatus)
  },
  "networkPerformanceConfig": {
    object (NetworkPerformanceConfig)
  },
  "keyRevocationActionType": enum (KeyRevocationActionType)
}
Fields
kind

string

[Output Only] Type of the resource. Always

compute#instance

for instances.

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)

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.

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 (Status)

[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 source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding.

networkInterfaces[]

object (NetworkInterface)

An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance.

disks[]

object (AttachedDisk)

Array of disks associated with this instance. Persistent disks must be created before you can assign them.

metadata

object (Metadata)

The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys.

serviceAccounts[]

object (ServiceAccount)

A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported.

Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information.

scheduling

object (Scheduling)

Sets the scheduling options for this instance.

cpuPlatform

string

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

labels

map (key: string, value: string)

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

setLabels

method.

params

object (InstanceParams)

Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload.

labelFingerprint

string (bytes format)

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.

A base64-encoded string.

instanceEncryptionKey

object (CustomerEncryptionKey)

Encrypts suspended data for an instance with a customer-managed encryption key.

If you are creating a new instance, this field will encrypt the local SSD and in-memory contents of the instance during the suspend operation.

If you do not provide an encryption key when creating the instance, then the local SSD and in-memory contents will be encrypted using an automatically generated key during the suspend operation.

minCpuPlatform

string

Specifies a minimum 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"

.

guestAccelerators[]

object (AcceleratorConfig)

A list of the type and count of accelerator cards attached to the instance.

startRestricted

boolean

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

deletionProtection

boolean

Whether the resource should be protected against deletion.

resourcePolicies[]

string

Resource policies applied to this instance.

sourceMachineImage

string

Source machine image

reservationAffinity

object (ReservationAffinity)

Specifies the reservations that this instance can consume from.

hostname

string

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.

displayDevice

object (DisplayDevice)

Enables display device for the instance.

shieldedInstanceConfig

object (ShieldedInstanceConfig)

shieldedInstanceIntegrityPolicy

object (ShieldedInstanceIntegrityPolicy)

sourceMachineImageEncryptionKey

object (CustomerEncryptionKey)

Source machine image encryption key when creating an instance from a machine image.

confidentialInstanceConfig

object (ConfidentialInstanceConfig)

fingerprint

string (bytes format)

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.

A base64-encoded string.

privateIpv6GoogleAccess

enum (InstancePrivateIpv6GoogleAccess)

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

INHERIT_FROM_SUBNETWORK

as default.

advancedMachineFeatures

object (AdvancedMachineFeatures)

Controls for advanced machine-related behavior features.

lastStartTimestamp

string

[Output Only] Last start timestamp in RFC3339 text format.

lastStopTimestamp

string

[Output Only] Last stop timestamp in RFC3339 text format.

lastSuspendedTimestamp

string

[Output Only] Last suspended timestamp in RFC3339 text format.

satisfiesPzs

boolean

[Output Only] Reserved for future use.

satisfiesPzi

boolean

[Output Only] Reserved for future use.

resourceStatus

object (ResourceStatus)

[Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field.

networkPerformanceConfig

object (NetworkPerformanceConfig)

keyRevocationActionType

enum (KeyRevocationActionType)

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

Status

Enums
PROVISIONING Resources are being allocated for the instance.
STAGING All required resources have been allocated and the instance is being started.
RUNNING The instance is running.
STOPPING The instance is currently stopping (either being deleted or killed).
STOPPED The instance has stopped successfully.
TERMINATED The instance has stopped (either by explicit action or underlying failure).
SUSPENDING The instance is suspending.
SUSPENDED The instance has suspended.
REPAIRING The instance is in repair.
DEPROVISIONING The instance is halted and we are performing tear down tasks like network deprogramming, releasing quota, IP, tearing down disks etc.

InstanceParams

Additional instance params.

JSON representation
{
  "resourceManagerTags": {
    string: string,
    ...
  }
}
Fields
resourceManagerTags

map (key: string, value: string)

Resource manager tags to be bound to the instance. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456. The field is ignored (both PUT & PATCH) when empty.

DisplayDevice

A set of Display Device options

JSON representation
{
  "enableDisplay": boolean
}
Fields
enableDisplay

boolean

Defines whether the instance has Display enabled.

ShieldedInstanceIntegrityPolicy

The policy describes the baseline against which Instance boot integrity is measured.

JSON representation
{

  // Union field policy can be only one of the following:
  "updateAutoLearnPolicy": boolean
  // End of list of possible types for union field policy.
}
Fields

Union field policy.

policy can be only one of the following:

updateAutoLearnPolicy

boolean

Updates the integrity policy baseline using the measurements from the VM instance's most recent boot.

ResourceStatus

Contains output only fields. Use this sub-message for actual values set on Instance attributes as compared to the value requested by the user (intent) in their instance CRUD calls.

JSON representation
{
  "scheduling": {
    object (Scheduling)
  },
  "upcomingMaintenance": {
    object (UpcomingMaintenance)
  },
  "physicalHost": string
}
Fields
scheduling

object (Scheduling)

upcomingMaintenance

object (UpcomingMaintenance)

physicalHost

string

[Output Only] The precise location of your instance within the zone's data center, including the block, sub-block, and host. The field is formatted as follows: blockId/subBlockId/hostId.

Scheduling

JSON representation
{
  "availabilityDomain": integer
}
Fields
availabilityDomain

integer

Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance.

UpcomingMaintenance

Upcoming Maintenance notification information.

JSON representation
{
  "type": enum (MaintenanceType),
  "canReschedule": boolean,
  "windowStartTime": string,
  "windowEndTime": string,
  "latestWindowStartTime": string,
  "maintenanceStatus": enum (MaintenanceStatus)
}
Fields
type

enum (MaintenanceType)

Defines the type of maintenance.

canReschedule

boolean

Indicates if the maintenance can be customer triggered.

windowStartTime

string

The current start time of the maintenance window. This timestamp value is in RFC3339 text format.

windowEndTime

string

The time by which the maintenance disruption will be completed. This timestamp value is in RFC3339 text format.

latestWindowStartTime

string

The latest time for the planned maintenance window to start. This timestamp value is in RFC3339 text format.

maintenanceStatus

enum (MaintenanceStatus)

MaintenanceType

Enums
UNKNOWN_TYPE No type specified. Do not use this value.
SCHEDULED Scheduled maintenance (e.g. maintenance after uptime guarantee is complete).
UNSCHEDULED Unscheduled maintenance (e.g. emergency maintenance during uptime guarantee).

MaintenanceStatus

Enums
UNKNOWN Unknown maintenance status. Do not use this value.
PENDING There is pending maintenance.
ONGOING There is ongoing maintenance on this VM.

Methods

addAccessConfig

The method compute.v1.InstancesService.AddAccessConfig is not available in this (s3nsapis.fr) universe.

addResourcePolicies

The method compute.v1.InstancesService.AddResourcePolicies is not available in this (s3nsapis.fr) universe.

aggregatedList

The method compute.v1.InstancesService.AggregatedList is not available in this (s3nsapis.fr) universe.

attachDisk

The method compute.v1.InstancesService.AttachDisk is not available in this (s3nsapis.fr) universe.

bulkInsert

The method compute.v1.InstancesService.BulkInsert is not available in this (s3nsapis.fr) universe.

delete

The method compute.v1.InstancesService.Delete is not available in this (s3nsapis.fr) universe.

deleteAccessConfig

The method compute.v1.InstancesService.DeleteAccessConfig is not available in this (s3nsapis.fr) universe.

detachDisk

The method compute.v1.InstancesService.DetachDisk is not available in this (s3nsapis.fr) universe.

get

The method compute.v1.InstancesService.Get is not available in this (s3nsapis.fr) universe.

getEffectiveFirewalls

The method compute.v1.InstancesService.GetEffectiveFirewalls is not available in this (s3nsapis.fr) universe.

getGuestAttributes

The method compute.v1.InstancesService.GetGuestAttributes is not available in this (s3nsapis.fr) universe.

getIamPolicy

The method compute.v1.InstancesService.GetPolicy is not available in this (s3nsapis.fr) universe.

getScreenshot

The method compute.v1.InstancesService.GetScreenshot is not available in this (s3nsapis.fr) universe.

getSerialPortOutput

The method compute.v1.InstancesService.GetSerialPortOutput is not available in this (s3nsapis.fr) universe.

getShieldedInstanceIdentity

The method compute.v1.InstancesService.GetShieldedInstanceIdentity is not available in this (s3nsapis.fr) universe.

insert

The method compute.v1.InstancesService.Insert is not available in this (s3nsapis.fr) universe.

list

The method compute.v1.InstancesService.List is not available in this (s3nsapis.fr) universe.

listReferrers

The method compute.v1.InstancesService.ListReferrers is not available in this (s3nsapis.fr) universe.

performMaintenance

The method compute.v1.InstancesService.PerformMaintenance is not available in this (s3nsapis.fr) universe.

removeResourcePolicies

The method compute.v1.InstancesService.RemoveResourcePolicies is not available in this (s3nsapis.fr) universe.

reset

The method compute.v1.InstancesService.Reset is not available in this (s3nsapis.fr) universe.

resume

The method compute.v1.InstancesService.Resume is not available in this (s3nsapis.fr) universe.

sendDiagnosticInterrupt

The method compute.v1.InstancesService.SendDiagnosticInterrupt is not available in this (s3nsapis.fr) universe.

setDeletionProtection

The method compute.v1.InstancesService.SetDeletionProtection is not available in this (s3nsapis.fr) universe.

setDiskAutoDelete

The method compute.v1.InstancesService.SetDiskAutoDelete is not available in this (s3nsapis.fr) universe.

setIamPolicy

The method compute.v1.InstancesService.SetPolicy is not available in this (s3nsapis.fr) universe.

setLabels

The method compute.v1.InstancesService.SetLabels is not available in this (s3nsapis.fr) universe.

setMachineResources

The method compute.v1.InstancesService.SetMachineResources is not available in this (s3nsapis.fr) universe.

setMachineType

The method compute.v1.InstancesService.SetMachineType is not available in this (s3nsapis.fr) universe.

setMetadata

The method compute.v1.InstancesService.SetMetadata is not available in this (s3nsapis.fr) universe.

setMinCpuPlatform

The method compute.v1.InstancesService.SetMinCpuPlatform is not available in this (s3nsapis.fr) universe.

setName

The method compute.v1.InstancesService.SetName is not available in this (s3nsapis.fr) universe.

setScheduling

The method compute.v1.InstancesService.SetScheduling is not available in this (s3nsapis.fr) universe.

setSecurityPolicy

The method compute.v1.InstancesService.SetSecurityPolicy is not available in this (s3nsapis.fr) universe.

setServiceAccount

The method compute.v1.InstancesService.SetServiceAccount is not available in this (s3nsapis.fr) universe.

setShieldedInstanceIntegrityPolicy

The method compute.v1.InstancesService.SetShieldedInstanceIntegrityPolicy is not available in this (s3nsapis.fr) universe.

setTags

The method compute.v1.InstancesService.SetTags is not available in this (s3nsapis.fr) universe.

simulateMaintenanceEvent

The method compute.v1.InstancesService.SimulateMaintenanceEvent is not available in this (s3nsapis.fr) universe.

start

The method compute.v1.InstancesService.Start is not available in this (s3nsapis.fr) universe.

startWithEncryptionKey

The method compute.v1.InstancesService.StartWithEncryptionKey is not available in this (s3nsapis.fr) universe.

stop

The method compute.v1.InstancesService.Stop is not available in this (s3nsapis.fr) universe.

suspend

The method compute.v1.InstancesService.Suspend is not available in this (s3nsapis.fr) universe.

testIamPermissions

The method compute.v1.InstancesService.TestPermissions is not available in this (s3nsapis.fr) universe.

update

The method compute.v1.InstancesService.Update is not available in this (s3nsapis.fr) universe.

updateAccessConfig

The method compute.v1.InstancesService.UpdateAccessConfig is not available in this (s3nsapis.fr) universe.

updateDisplayDevice

The method compute.v1.InstancesService.UpdateDisplayDevice is not available in this (s3nsapis.fr) universe.

updateNetworkInterface

The method compute.v1.InstancesService.UpdateNetworkInterface is not available in this (s3nsapis.fr) universe.

updateShieldedInstanceConfig

The method compute.v1.InstancesService.UpdateShieldedInstanceConfig is not available in this (s3nsapis.fr) universe.