Instance

A set of methods for managing Instance resources.

JSON Representation

{
  "id": "string",
  "folderId": "string",
  "createdAt": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "zoneId": "string",
  "platformId": "string",
  "resources": {
    "memory": "string",
    "cores": "string",
    "coreFraction": "string",
    "gpus": "string"
  },
  "status": "string",
  "metadata": "object",
  "bootDisk": {
    "mode": "string",
    "deviceName": "string",
    "autoDelete": true,
    "diskId": "string"
  },
  "secondaryDisks": [
    {
      "mode": "string",
      "deviceName": "string",
      "autoDelete": true,
      "diskId": "string"
    }
  ],
  "networkInterfaces": [
    {
      "index": "string",
      "macAddress": "string",
      "subnetId": "string",
      "primaryV4Address": {
        "address": "string",
        "oneToOneNat": {
          "address": "string",
          "ipVersion": "string"
        }
      },
      "primaryV6Address": {
        "address": "string",
        "oneToOneNat": {
          "address": "string",
          "ipVersion": "string"
        }
      }
    }
  ],
  "fqdn": "string",
  "schedulingPolicy": {
    "preemptible": true
  },
  "serviceAccountId": "string",
  "networkSettings": {
    "type": "string"
  }
}
Field Description
id string

ID of the instance.

folderId string

ID of the folder that the instance belongs to.

createdAt string (date-time)

String in RFC3339 text format.

name string

Name of the instance. 1-63 characters long.

description string

Description of the instance. 0-256 characters long.

labels object

Resource labels as key:value pairs. Maximum of 64 per resource.

zoneId string

ID of the availability zone where the instance resides.

platformId string

ID of the hardware platform configuration for the instance.

resources object

Computing resources of the instance such as the amount of memory and number of cores.

resources.
memory
string (int64)

The amount of memory available to the instance, specified in bytes.

resources.
cores
string (int64)

The number of cores available to the instance.

resources.
coreFraction
string (int64)

Baseline level of CPU performance with the ability to burst performance above that baseline level. This field sets baseline performance for each core.

resources.
gpus
string (int64)

The number of GPUs available to the instance.

status string

Status of the instance.

  • PROVISIONING: Instance is waiting for resources to be allocated.
  • RUNNING: Instance is running normally.
  • STOPPING: Instance is being stopped.
  • STOPPED: Instance stopped.
  • STARTING: Instance is being started.
  • RESTARTING: Instance is being restarted.
  • UPDATING: Instance is being updated.
  • ERROR: Instance encountered a problem and cannot operate.
  • CRASHED: Instance crashed and will be restarted automatically.
  • DELETING: Instance is being deleted.
metadata object

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

For example, you may use the metadata in order to provide your public SSH key to the instance. For more information, see Metadata.

bootDisk object

Boot disk that is attached to the instance.

bootDisk.
mode
string

Access mode to the Disk resource.

  • READ_ONLY: Read-only access.
  • READ_WRITE: Read/Write access.
bootDisk.
deviceName
string

Serial number that is reflected into the /dev/disk/by-id/ tree of a Linux operating system running within the instance.

This value can be used to reference the device for mounting, resizing, and so on, from within the instance.

bootDisk.
autoDelete
boolean (boolean)

Specifies whether the disk will be auto-deleted when the instance is deleted.

bootDisk.
diskId
string

ID of the disk that is attached to the instance.

secondaryDisks[] object

Array of secondary disks that are attached to the instance.

secondaryDisks[].
mode
string

Access mode to the Disk resource.

  • READ_ONLY: Read-only access.
  • READ_WRITE: Read/Write access.
secondaryDisks[].
deviceName
string

Serial number that is reflected into the /dev/disk/by-id/ tree of a Linux operating system running within the instance.

This value can be used to reference the device for mounting, resizing, and so on, from within the instance.

secondaryDisks[].
autoDelete
boolean (boolean)

Specifies whether the disk will be auto-deleted when the instance is deleted.

secondaryDisks[].
diskId
string

ID of the disk that is attached to the instance.

networkInterfaces[] object

Array of network interfaces that are attached to the instance.

networkInterfaces[].
index
string

The index of the network interface, generated by the server, 0,1,2... etc. Currently only one network interface is supported per instance.

networkInterfaces[].
macAddress
string

MAC address that is assigned to the network interface.

networkInterfaces[].
subnetId
string

ID of the subnet.

networkInterfaces[].
primaryV4Address
object

Primary IPv4 address that is assigned to the instance for this network interface.

networkInterfaces[].
primaryV4Address.
address
string

An IPv4 internal network address that is assigned to the instance for this network interface.

networkInterfaces[].
primaryV4Address.
oneToOneNat
object

One-to-one NAT configuration. If missing, NAT has not been set up.

networkInterfaces[].
primaryV4Address.
oneToOneNat.
address
string

An external IP address associated with this instance.

networkInterfaces[].
primaryV4Address.
oneToOneNat.
ipVersion
string

IP version for the external IP address.

  • IPV4: IPv4 address, for example 192.0.2.235.
  • IPV6: IPv6 address. Not available yet.
networkInterfaces[].
primaryV6Address
object

Primary IPv6 address that is assigned to the instance for this network interface. IPv6 not available yet.

networkInterfaces[].
primaryV6Address.
address
string

An IPv4 internal network address that is assigned to the instance for this network interface.

networkInterfaces[].
primaryV6Address.
oneToOneNat
object

One-to-one NAT configuration. If missing, NAT has not been set up.

networkInterfaces[].
primaryV6Address.
oneToOneNat.
address
string

An external IP address associated with this instance.

networkInterfaces[].
primaryV6Address.
oneToOneNat.
ipVersion
string

IP version for the external IP address.

  • IPV4: IPv4 address, for example 192.0.2.235.
  • IPV6: IPv6 address. Not available yet.
fqdn string

A domain name of the instance. FQDN is defined by the server in the format <hostname>.<region_id>.internal when the instance is created. If the hostname were not specified when the instance was created, FQDN would be <id>.auto.internal.

schedulingPolicy object

Scheduling policy configuration.

schedulingPolicy.
preemptible
boolean (boolean)

True for short-lived compute instances. For more information, see Preemptible VMs.

serviceAccountId string

ID of the service account to use for authentication inside the instance. To get the service account ID, use a list request.

networkSettings object

Do not specify this field, network settings are not supported yet.

networkSettings.
type
string

Do not specify this field, network settings are not supported yet.

  • STANDARD: Standard network.
  • SOFTWARE_ACCELERATED: Software accelerated network.
  • HARDWARE_ACCELERATED: Hardware accelerated network (not available yet, reserved for future use).

Methods

Method Description
attachDisk Attaches the disk to the instance.
create Creates an instance in the specified folder. Method starts an asynchronous operation that can be cancelled while it is in progress.
delete Deletes the specified instance.
detachDisk Detaches the disk from the instance.
get Returns the specified Instance resource.
getSerialPortOutput Returns the serial port output of the specified Instance resource.
list Retrieves the list of Instance resources in the specified folder.
listOperations Lists operations for the specified instance.
restart Restarts the running instance.
start Starts the stopped instance.
stop Stops the running instance.
update Updates the specified instance.
updateMetadata Updates the metadata of the specified instance.