instances
Creates, updates, deletes, gets or lists an instances
resource.
Overview
Name | instances |
Type | Resource |
Id | google.compute.instances |
Fields
The following fields are returned by SELECT
queries:
- get
- list
- aggregated_list
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
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. (pattern: a-z?) |
advancedMachineFeatures | object | Controls for advanced machine-related behavior features. (id: AdvancedMachineFeatures) |
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 . |
confidentialInstanceConfig | object | A set of Confidential Instance options. (id: ConfidentialInstanceConfig) |
cpuPlatform | string | [Output Only] The CPU platform used by this instance. |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
deletionProtection | boolean | Whether the resource should be protected against deletion. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
disks | array | Array of disks associated with this instance. Persistent disks must be created before you can assign them. |
displayDevice | object | Enables display device for the instance. (id: DisplayDevice) |
fingerprint | string (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. |
guestAccelerators | array | A list of the type and count of accelerator cards attached to the instance. |
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. |
instanceEncryptionKey | object | 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. (id: CustomerEncryptionKey) |
keyRevocationActionType | string | KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. |
kind | string | [Output Only] Type of the resource. Always compute#instance for instances. (default: compute#instance) |
labelFingerprint | string (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. |
labels | object | Labels to apply to this instance. These can be later modified by the setLabels method. |
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. |
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. |
metadata | object | The metadata key/value pairs assigned to this instance. This includes metadata keys that were explicitly defined for the instance. (id: Metadata) |
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". |
networkInterfaces | array | 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. |
networkPerformanceConfig | object | (id: NetworkPerformanceConfig) |
params | object | Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. (id: InstanceParams) |
privateIpv6GoogleAccess | string | The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. |
reservationAffinity | object | Specifies the reservations that this instance can consume from. (id: ReservationAffinity) |
resourcePolicies | array | Resource policies applied to this instance. |
resourceStatus | object | [Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field. (id: ResourceStatus) |
satisfiesPzi | boolean | [Output Only] Reserved for future use. |
satisfiesPzs | boolean | [Output Only] Reserved for future use. |
scheduling | object | Sets the scheduling options for this instance. (id: Scheduling) |
selfLink | string | [Output Only] Server-defined URL for this resource. |
serviceAccounts | array | 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. |
shieldedInstanceConfig | object | A set of Shielded Instance options. (id: ShieldedInstanceConfig) |
shieldedInstanceIntegrityPolicy | object | The policy describes the baseline against which Instance boot integrity is measured. (id: ShieldedInstanceIntegrityPolicy) |
sourceMachineImage | string | Source machine image |
sourceMachineImageEncryptionKey | object | Source machine image encryption key when creating an instance from a machine image. (id: CustomerEncryptionKey) |
startRestricted | boolean | [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. |
status | string | [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. |
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. (id: Tags) |
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. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of Instance resources. |
kind | string | [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. (default: compute#instanceList) |
nextPageToken | string | [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |
selfLink | string | [Output Only] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
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. (pattern: a-z?) |
advancedMachineFeatures | object | Controls for advanced machine-related behavior features. (id: AdvancedMachineFeatures) |
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 . |
confidentialInstanceConfig | object | A set of Confidential Instance options. (id: ConfidentialInstanceConfig) |
cpuPlatform | string | [Output Only] The CPU platform used by this instance. |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
deletionProtection | boolean | Whether the resource should be protected against deletion. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
disks | array | Array of disks associated with this instance. Persistent disks must be created before you can assign them. |
displayDevice | object | Enables display device for the instance. (id: DisplayDevice) |
fingerprint | string (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. |
guestAccelerators | array | A list of the type and count of accelerator cards attached to the instance. |
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. |
instanceEncryptionKey | object | 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. (id: CustomerEncryptionKey) |
keyRevocationActionType | string | KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified. |
kind | string | [Output Only] Type of the resource. Always compute#instance for instances. (default: compute#instance) |
labelFingerprint | string (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. |
labels | object | Labels to apply to this instance. These can be later modified by the setLabels method. |
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. |
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. |
metadata | object | The metadata key/value pairs assigned to this instance. This includes metadata keys that were explicitly defined for the instance. (id: Metadata) |
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". |
networkInterfaces | array | 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. |
networkPerformanceConfig | object | (id: NetworkPerformanceConfig) |
params | object | Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. (id: InstanceParams) |
privateIpv6GoogleAccess | string | The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. |
reservationAffinity | object | Specifies the reservations that this instance can consume from. (id: ReservationAffinity) |
resourcePolicies | array | Resource policies applied to this instance. |
resourceStatus | object | [Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field. (id: ResourceStatus) |
satisfiesPzi | boolean | [Output Only] Reserved for future use. |
satisfiesPzs | boolean | [Output Only] Reserved for future use. |
scheduling | object | Sets the scheduling options for this instance. (id: Scheduling) |
selfLink | string | [Output Only] Server-defined URL for this resource. |
serviceAccounts | array | 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. |
shieldedInstanceConfig | object | A set of Shielded Instance options. (id: ShieldedInstanceConfig) |
shieldedInstanceIntegrityPolicy | object | The policy describes the baseline against which Instance boot integrity is measured. (id: ShieldedInstanceIntegrityPolicy) |
sourceMachineImage | string | Source machine image |
sourceMachineImageEncryptionKey | object | Source machine image encryption key when creating an instance from a machine image. (id: CustomerEncryptionKey) |
startRestricted | boolean | [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. |
status | string | [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. |
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. (id: Tags) |
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. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , zone , instance | Returns the specified Instance resource. | |
list | select | project , zone | filter , maxResults , orderBy , pageToken , returnPartialSuccess | Retrieves the list of instances contained within the specified zone. |
aggregated_list | select | project | filter , includeAllScopes , maxResults , orderBy , pageToken , returnPartialSuccess , serviceProjectNumber | Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true . |
insert | insert | project , zone | requestId , sourceInstanceTemplate , sourceMachineImage | Creates an instance resource in the specified project using the data included in the request. |
update | replace | project , zone , instance | minimalAction , mostDisruptiveAllowedAction , requestId | Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. |
delete | delete | project , zone , instance | requestId | Deletes the specified Instance resource. For more information, see Deleting an instance. |
reset | exec | project , zone , instance | requestId | Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance. |
simulate_maintenance_event | exec | project , zone , instance | requestId , withExtendedNotifications | Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event. |
perform_maintenance | exec | project , zone , instance | requestId | Perform a manual maintenance on the instance. |
report_host_as_faulty | exec | project , zone , instance | requestId | Mark the host as faulty and try to restart the instance on a new host. |
update_network_interface | exec | project , zone , instance , networkInterface | requestId | Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. |
set_scheduling | exec | project , zone , instance | requestId | Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy. |
send_diagnostic_interrupt | exec | project , zone , instance | Sends diagnostic interrupt to the instance. | |
attach_disk | exec | project , zone , instance | forceAttach , requestId | Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. |
detach_disk | exec | project , zone , instance , deviceName | requestId | Detaches a disk from an instance. |
set_machine_resources | exec | project , zone , instance | requestId | Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. |
set_machine_type | exec | project , zone , instance | requestId | Changes the machine type for a stopped instance to the machine type specified in the request. |
set_metadata | exec | project , zone , instance | requestId | Sets metadata for the specified instance to the data included in the request. |
set_min_cpu_platform | exec | project , zone , instance | requestId | Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. |
set_tags | exec | project , zone , instance | requestId | Sets network tags for the specified instance to the data included in the request. |
set_labels | exec | project , zone , instance | requestId | Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. |
set_name | exec | project , zone , instance | requestId | Sets name of an instance. |
set_disk_auto_delete | exec | project , zone , instance , autoDelete , deviceName | requestId | Sets the auto-delete flag for a disk attached to an instance. |
start | exec | project , zone , instance | requestId | Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. |
start_with_encryption_key | exec | project , zone , instance | requestId | Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. |
stop | exec | project , zone , instance | discardLocalSsd , requestId | Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. |
set_service_account | exec | project , zone , instance | requestId | Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. |
set_deletion_protection | exec | project , zone , resource | deletionProtection , requestId | Sets deletion protection on the instance. |
suspend | exec | project , zone , instance | discardLocalSsd , requestId | This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance. |
resume | exec | project , zone , instance | requestId | Resumes an instance that was suspended using the instances().suspend method. |
update_shielded_instance_config | exec | project , zone , instance | requestId | Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
update_display_device | exec | project , zone , instance | requestId | Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
set_shielded_instance_integrity_policy | exec | project , zone , instance | requestId | Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
set_security_policy | exec | project , zone , instance | requestId | Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview |
bulk_insert | exec | project , region | requestId | Creates multiple instances in a given region. Count specifies the number of instances to create. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
autoDelete | boolean | |
deviceName | string | |
instance | string | |
networkInterface | string | |
project | string | |
region | string | |
resource | string | |
zone | string | |
deletionProtection | boolean | |
discardLocalSsd | boolean | |
filter | string | |
forceAttach | boolean | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
minimalAction | string | |
mostDisruptiveAllowedAction | string | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) | |
sourceInstanceTemplate | string | |
sourceMachineImage | string | |
withExtendedNotifications | boolean |
SELECT
examples
- get
- list
- aggregated_list
Returns the specified Instance resource.
SELECT
id,
name,
advancedMachineFeatures,
canIpForward,
confidentialInstanceConfig,
cpuPlatform,
creationTimestamp,
deletionProtection,
description,
disks,
displayDevice,
fingerprint,
guestAccelerators,
hostname,
instanceEncryptionKey,
keyRevocationActionType,
kind,
labelFingerprint,
labels,
lastStartTimestamp,
lastStopTimestamp,
lastSuspendedTimestamp,
machineType,
metadata,
minCpuPlatform,
networkInterfaces,
networkPerformanceConfig,
params,
privateIpv6GoogleAccess,
reservationAffinity,
resourcePolicies,
resourceStatus,
satisfiesPzi,
satisfiesPzs,
scheduling,
selfLink,
serviceAccounts,
shieldedInstanceConfig,
shieldedInstanceIntegrityPolicy,
sourceMachineImage,
sourceMachineImageEncryptionKey,
startRestricted,
status,
statusMessage,
tags,
zone
FROM google.compute.instances
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND instance = '{{ instance }}' -- required;
Retrieves the list of instances contained within the specified zone.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.instances
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';
Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the returnPartialSuccess
parameter to true
.
SELECT
id,
name,
advancedMachineFeatures,
canIpForward,
confidentialInstanceConfig,
cpuPlatform,
creationTimestamp,
deletionProtection,
description,
disks,
displayDevice,
fingerprint,
guestAccelerators,
hostname,
instanceEncryptionKey,
keyRevocationActionType,
kind,
labelFingerprint,
labels,
lastStartTimestamp,
lastStopTimestamp,
lastSuspendedTimestamp,
machineType,
metadata,
minCpuPlatform,
networkInterfaces,
networkPerformanceConfig,
params,
privateIpv6GoogleAccess,
reservationAffinity,
resourcePolicies,
resourceStatus,
satisfiesPzi,
satisfiesPzs,
scheduling,
selfLink,
serviceAccounts,
shieldedInstanceConfig,
shieldedInstanceIntegrityPolicy,
sourceMachineImage,
sourceMachineImageEncryptionKey,
startRestricted,
status,
statusMessage,
tags,
zone
FROM google.compute.instances
WHERE project = '{{ project }}' -- required
AND filter = '{{ filter }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}';
INSERT
examples
- insert
- Manifest
Creates an instance resource in the specified project using the data included in the request.
INSERT INTO google.compute.instances (
data__kind,
data__id,
data__creationTimestamp,
data__name,
data__description,
data__tags,
data__machineType,
data__status,
data__statusMessage,
data__zone,
data__canIpForward,
data__networkInterfaces,
data__disks,
data__metadata,
data__serviceAccounts,
data__selfLink,
data__scheduling,
data__cpuPlatform,
data__labels,
data__params,
data__labelFingerprint,
data__instanceEncryptionKey,
data__minCpuPlatform,
data__guestAccelerators,
data__startRestricted,
data__deletionProtection,
data__resourcePolicies,
data__sourceMachineImage,
data__reservationAffinity,
data__hostname,
data__displayDevice,
data__shieldedInstanceConfig,
data__shieldedInstanceIntegrityPolicy,
data__sourceMachineImageEncryptionKey,
data__confidentialInstanceConfig,
data__fingerprint,
data__privateIpv6GoogleAccess,
data__advancedMachineFeatures,
data__lastStartTimestamp,
data__lastStopTimestamp,
data__lastSuspendedTimestamp,
data__satisfiesPzs,
data__satisfiesPzi,
data__resourceStatus,
data__networkPerformanceConfig,
data__keyRevocationActionType,
project,
zone,
requestId,
sourceInstanceTemplate,
sourceMachineImage
)
SELECT
'{{ kind }}',
'{{ id }}',
'{{ creationTimestamp }}',
'{{ name }}',
'{{ description }}',
'{{ tags }}',
'{{ machineType }}',
'{{ status }}',
'{{ statusMessage }}',
'{{ zone }}',
{{ canIpForward }},
'{{ networkInterfaces }}',
'{{ disks }}',
'{{ metadata }}',
'{{ serviceAccounts }}',
'{{ selfLink }}',
'{{ scheduling }}',
'{{ cpuPlatform }}',
'{{ labels }}',
'{{ params }}',
'{{ labelFingerprint }}',
'{{ instanceEncryptionKey }}',
'{{ minCpuPlatform }}',
'{{ guestAccelerators }}',
{{ startRestricted }},
{{ deletionProtection }},
'{{ resourcePolicies }}',
'{{ sourceMachineImage }}',
'{{ reservationAffinity }}',
'{{ hostname }}',
'{{ displayDevice }}',
'{{ shieldedInstanceConfig }}',
'{{ shieldedInstanceIntegrityPolicy }}',
'{{ sourceMachineImageEncryptionKey }}',
'{{ confidentialInstanceConfig }}',
'{{ fingerprint }}',
'{{ privateIpv6GoogleAccess }}',
'{{ advancedMachineFeatures }}',
'{{ lastStartTimestamp }}',
'{{ lastStopTimestamp }}',
'{{ lastSuspendedTimestamp }}',
{{ satisfiesPzs }},
{{ satisfiesPzi }},
'{{ resourceStatus }}',
'{{ networkPerformanceConfig }}',
'{{ keyRevocationActionType }}',
'{{ project }}',
'{{ zone }}',
'{{ requestId }}',
'{{ sourceInstanceTemplate }}',
'{{ sourceMachineImage }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;
# Description fields are for documentation purposes
- name: instances
props:
- name: project
value: string
description: Required parameter for the instances resource.
- name: zone
value: string
description: Required parameter for the instances resource.
- name: kind
value: string
description: >
[Output Only] Type of the resource. Always compute#instance for instances.
default: compute#instance
- name: id
value: string
description: >
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- name: creationTimestamp
value: string
description: >
[Output Only] Creation timestamp in RFC3339 text format.
- name: name
value: string
description: >
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.
- name: description
value: string
description: >
An optional description of this resource. Provide this property when you create the resource.
- name: tags
value: object
description: >
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.
- name: machineType
value: string
description: >
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.
- name: status
value: string
description: >
[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.
valid_values: ['DEPROVISIONING', 'PROVISIONING', 'REPAIRING', 'RUNNING', 'STAGING', 'STOPPED', 'STOPPING', 'SUSPENDED', 'SUSPENDING', 'TERMINATED']
- name: statusMessage
value: string
description: >
[Output Only] An optional, human-readable explanation of the status.
- name: zone
value: string
description: >
[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.
- name: canIpForward
value: boolean
description: >
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 .
- name: networkInterfaces
value: array
description: >
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.
- name: disks
value: array
description: >
Array of disks associated with this instance. Persistent disks must be created before you can assign them.
- name: metadata
value: object
description: >
The metadata key/value pairs assigned to this instance. This includes metadata keys that were explicitly defined for the instance.
- name: serviceAccounts
value: array
description: >
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.
- name: selfLink
value: string
description: >
[Output Only] Server-defined URL for this resource.
- name: scheduling
value: object
description: >
Sets the scheduling options for this instance.
- name: cpuPlatform
value: string
description: >
[Output Only] The CPU platform used by this instance.
- name: labels
value: object
description: >
Labels to apply to this instance. These can be later modified by the setLabels method.
- name: params
value: object
description: >
Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload.
- name: labelFingerprint
value: string
description: >
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.
- name: instanceEncryptionKey
value: object
description: >
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.
- name: minCpuPlatform
value: string
description: >
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".
- name: guestAccelerators
value: array
description: >
A list of the type and count of accelerator cards attached to the instance.
- name: startRestricted
value: boolean
description: >
[Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity.
- name: deletionProtection
value: boolean
description: >
Whether the resource should be protected against deletion.
- name: resourcePolicies
value: array
description: >
Resource policies applied to this instance.
- name: sourceMachineImage
value: string
description: >
Source machine image
- name: reservationAffinity
value: object
description: >
Specifies the reservations that this instance can consume from.
- name: hostname
value: string
description: >
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.
- name: displayDevice
value: object
description: >
Enables display device for the instance.
- name: shieldedInstanceConfig
value: object
description: >
A set of Shielded Instance options.
- name: shieldedInstanceIntegrityPolicy
value: object
description: >
The policy describes the baseline against which Instance boot integrity is measured.
- name: sourceMachineImageEncryptionKey
value: object
description: >
Source machine image encryption key when creating an instance from a machine image.
- name: confidentialInstanceConfig
value: object
description: >
A set of Confidential Instance options.
- name: fingerprint
value: string
description: >
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.
- name: privateIpv6GoogleAccess
value: string
description: >
The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default.
valid_values: ['ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE', 'ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE', 'INHERIT_FROM_SUBNETWORK']
- name: advancedMachineFeatures
value: object
description: >
Controls for advanced machine-related behavior features.
- name: lastStartTimestamp
value: string
description: >
[Output Only] Last start timestamp in RFC3339 text format.
- name: lastStopTimestamp
value: string
description: >
[Output Only] Last stop timestamp in RFC3339 text format.
- name: lastSuspendedTimestamp
value: string
description: >
[Output Only] Last suspended timestamp in RFC3339 text format.
- name: satisfiesPzs
value: boolean
description: >
[Output Only] Reserved for future use.
- name: satisfiesPzi
value: boolean
description: >
[Output Only] Reserved for future use.
- name: resourceStatus
value: object
description: >
[Output Only] Specifies values set for instance attributes as compared to the values requested by user in the corresponding input only field.
- name: networkPerformanceConfig
value: object
- name: keyRevocationActionType
value: string
description: >
KeyRevocationActionType of the instance. Supported options are "STOP" and "NONE". The default value is "NONE" if it is not specified.
valid_values: ['KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED', 'NONE', 'STOP']
- name: requestId
value: string
- name: sourceInstanceTemplate
value: string
- name: sourceMachineImage
value: string
REPLACE
examples
- update
Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.
REPLACE google.compute.instances
SET
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__tags = '{{ tags }}',
data__machineType = '{{ machineType }}',
data__status = '{{ status }}',
data__statusMessage = '{{ statusMessage }}',
data__zone = '{{ zone }}',
data__canIpForward = {{ canIpForward }},
data__networkInterfaces = '{{ networkInterfaces }}',
data__disks = '{{ disks }}',
data__metadata = '{{ metadata }}',
data__serviceAccounts = '{{ serviceAccounts }}',
data__selfLink = '{{ selfLink }}',
data__scheduling = '{{ scheduling }}',
data__cpuPlatform = '{{ cpuPlatform }}',
data__labels = '{{ labels }}',
data__params = '{{ params }}',
data__labelFingerprint = '{{ labelFingerprint }}',
data__instanceEncryptionKey = '{{ instanceEncryptionKey }}',
data__minCpuPlatform = '{{ minCpuPlatform }}',
data__guestAccelerators = '{{ guestAccelerators }}',
data__startRestricted = {{ startRestricted }},
data__deletionProtection = {{ deletionProtection }},
data__resourcePolicies = '{{ resourcePolicies }}',
data__sourceMachineImage = '{{ sourceMachineImage }}',
data__reservationAffinity = '{{ reservationAffinity }}',
data__hostname = '{{ hostname }}',
data__displayDevice = '{{ displayDevice }}',
data__shieldedInstanceConfig = '{{ shieldedInstanceConfig }}',
data__shieldedInstanceIntegrityPolicy = '{{ shieldedInstanceIntegrityPolicy }}',
data__sourceMachineImageEncryptionKey = '{{ sourceMachineImageEncryptionKey }}',
data__confidentialInstanceConfig = '{{ confidentialInstanceConfig }}',
data__fingerprint = '{{ fingerprint }}',
data__privateIpv6GoogleAccess = '{{ privateIpv6GoogleAccess }}',
data__advancedMachineFeatures = '{{ advancedMachineFeatures }}',
data__lastStartTimestamp = '{{ lastStartTimestamp }}',
data__lastStopTimestamp = '{{ lastStopTimestamp }}',
data__lastSuspendedTimestamp = '{{ lastSuspendedTimestamp }}',
data__satisfiesPzs = {{ satisfiesPzs }},
data__satisfiesPzi = {{ satisfiesPzi }},
data__resourceStatus = '{{ resourceStatus }}',
data__networkPerformanceConfig = '{{ networkPerformanceConfig }}',
data__keyRevocationActionType = '{{ keyRevocationActionType }}'
WHERE
project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND instance = '{{ instance }}' --required
AND minimalAction = '{{ minimalAction}}'
AND mostDisruptiveAllowedAction = '{{ mostDisruptiveAllowedAction}}'
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
DELETE
examples
- delete
Deletes the specified Instance resource. For more information, see Deleting an instance.
DELETE FROM google.compute.instances
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND instance = '{{ instance }}' --required
AND requestId = '{{ requestId }}';
Lifecycle Methods
- reset
- simulate_maintenance_event
- perform_maintenance
- report_host_as_faulty
- update_network_interface
- set_scheduling
- send_diagnostic_interrupt
- attach_disk
- detach_disk
- set_machine_resources
- set_machine_type
- set_metadata
- set_min_cpu_platform
- set_tags
- set_labels
- set_name
- set_disk_auto_delete
- start
- start_with_encryption_key
- stop
- set_service_account
- set_deletion_protection
- suspend
- resume
- update_shielded_instance_config
- update_display_device
- set_shielded_instance_integrity_policy
- set_security_policy
- bulk_insert
Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance.
EXEC google.compute.instances.reset
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}';
Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.
EXEC google.compute.instances.simulate_maintenance_event
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}',
@withExtendedNotifications={{ withExtendedNotifications }};
Perform a manual maintenance on the instance.
EXEC google.compute.instances.perform_maintenance
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}';
Mark the host as faulty and try to restart the instance on a new host.
EXEC google.compute.instances.report_host_as_faulty
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"faultReasons": "{{ faultReasons }}",
"disruptionSchedule": "{{ disruptionSchedule }}"
}';
Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.
EXEC google.compute.instances.update_network_interface
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@networkInterface='{{ networkInterface }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"kind": "{{ kind }}",
"network": "{{ network }}",
"subnetwork": "{{ subnetwork }}",
"networkIP": "{{ networkIP }}",
"ipv6Address": "{{ ipv6Address }}",
"internalIpv6PrefixLength": {{ internalIpv6PrefixLength }},
"name": "{{ name }}",
"accessConfigs": "{{ accessConfigs }}",
"ipv6AccessConfigs": "{{ ipv6AccessConfigs }}",
"aliasIpRanges": "{{ aliasIpRanges }}",
"fingerprint": "{{ fingerprint }}",
"stackType": "{{ stackType }}",
"ipv6AccessType": "{{ ipv6AccessType }}",
"queueCount": {{ queueCount }},
"nicType": "{{ nicType }}",
"networkAttachment": "{{ networkAttachment }}"
}';
Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED
state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy.
EXEC google.compute.instances.set_scheduling
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"maxRunDuration": "{{ maxRunDuration }}",
"terminationTime": "{{ terminationTime }}",
"onInstanceStopAction": "{{ onInstanceStopAction }}",
"onHostMaintenance": "{{ onHostMaintenance }}",
"automaticRestart": {{ automaticRestart }},
"preemptible": {{ preemptible }},
"nodeAffinities": "{{ nodeAffinities }}",
"minNodeCpus": {{ minNodeCpus }},
"locationHint": "{{ locationHint }}",
"availabilityDomain": {{ availabilityDomain }},
"provisioningModel": "{{ provisioningModel }}",
"instanceTerminationAction": "{{ instanceTerminationAction }}",
"hostErrorTimeoutSeconds": {{ hostErrorTimeoutSeconds }},
"localSsdRecoveryTimeout": "{{ localSsdRecoveryTimeout }}"
}';
Sends diagnostic interrupt to the instance.
EXEC google.compute.instances.send_diagnostic_interrupt
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required;
Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.
EXEC google.compute.instances.attach_disk
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@forceAttach={{ forceAttach }},
@requestId='{{ requestId }}'
@@json=
'{
"kind": "{{ kind }}",
"type": "{{ type }}",
"mode": "{{ mode }}",
"savedState": "{{ savedState }}",
"source": "{{ source }}",
"deviceName": "{{ deviceName }}",
"index": {{ index }},
"boot": {{ boot }},
"initializeParams": "{{ initializeParams }}",
"autoDelete": {{ autoDelete }},
"licenses": "{{ licenses }}",
"interface": "{{ interface }}",
"guestOsFeatures": "{{ guestOsFeatures }}",
"diskEncryptionKey": "{{ diskEncryptionKey }}",
"diskSizeGb": "{{ diskSizeGb }}",
"shieldedInstanceInitialState": "{{ shieldedInstanceInitialState }}",
"forceAttach": {{ forceAttach }},
"architecture": "{{ architecture }}"
}';
Detaches a disk from an instance.
EXEC google.compute.instances.detach_disk
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@deviceName='{{ deviceName }}' --required,
@requestId='{{ requestId }}';
Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
EXEC google.compute.instances.set_machine_resources
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"guestAccelerators": "{{ guestAccelerators }}"
}';
Changes the machine type for a stopped instance to the machine type specified in the request.
EXEC google.compute.instances.set_machine_type
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"machineType": "{{ machineType }}"
}';
Sets metadata for the specified instance to the data included in the request.
EXEC google.compute.instances.set_metadata
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"kind": "{{ kind }}",
"fingerprint": "{{ fingerprint }}",
"items": "{{ items }}"
}';
Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.
EXEC google.compute.instances.set_min_cpu_platform
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"minCpuPlatform": "{{ minCpuPlatform }}"
}';
Sets network tags for the specified instance to the data included in the request.
EXEC google.compute.instances.set_tags
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"items": "{{ items }}",
"fingerprint": "{{ fingerprint }}"
}';
Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.
EXEC google.compute.instances.set_labels
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"labels": "{{ labels }}",
"labelFingerprint": "{{ labelFingerprint }}"
}';
Sets name of an instance.
EXEC google.compute.instances.set_name
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"name": "{{ name }}",
"currentName": "{{ currentName }}"
}';
Sets the auto-delete flag for a disk attached to an instance.
EXEC google.compute.instances.set_disk_auto_delete
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@autoDelete='{{ autoDelete }}' --required,
@deviceName='{{ deviceName }}' --required,
@requestId='{{ requestId }}';
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
EXEC google.compute.instances.start
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}';
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
EXEC google.compute.instances.start_with_encryption_key
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"disks": "{{ disks }}"
}';
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.
EXEC google.compute.instances.stop
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@discardLocalSsd={{ discardLocalSsd }},
@requestId='{{ requestId }}';
Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
EXEC google.compute.instances.set_service_account
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"email": "{{ email }}",
"scopes": "{{ scopes }}"
}';
Sets deletion protection on the instance.
EXEC google.compute.instances.set_deletion_protection
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@resource='{{ resource }}' --required,
@deletionProtection={{ deletionProtection }},
@requestId='{{ requestId }}';
This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance.
EXEC google.compute.instances.suspend
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@discardLocalSsd={{ discardLocalSsd }},
@requestId='{{ requestId }}';
Resumes an instance that was suspended using the instances().suspend method.
EXEC google.compute.instances.resume
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}';
Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
EXEC google.compute.instances.update_shielded_instance_config
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"enableSecureBoot": {{ enableSecureBoot }},
"enableVtpm": {{ enableVtpm }},
"enableIntegrityMonitoring": {{ enableIntegrityMonitoring }}
}';
Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
EXEC google.compute.instances.update_display_device
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"enableDisplay": {{ enableDisplay }}
}';
Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
EXEC google.compute.instances.set_shielded_instance_integrity_policy
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"updateAutoLearnPolicy": {{ updateAutoLearnPolicy }}
}';
Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview
EXEC google.compute.instances.set_security_policy
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@instance='{{ instance }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"securityPolicy": "{{ securityPolicy }}",
"networkInterfaces": "{{ networkInterfaces }}"
}';
Creates multiple instances in a given region. Count specifies the number of instances to create.
EXEC google.compute.instances.bulk_insert
@project='{{ project }}' --required,
@region='{{ region }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"count": "{{ count }}",
"minCount": "{{ minCount }}",
"namePattern": "{{ namePattern }}",
"perInstanceProperties": "{{ perInstanceProperties }}",
"sourceInstanceTemplate": "{{ sourceInstanceTemplate }}",
"instanceProperties": "{{ instanceProperties }}",
"locationPolicy": "{{ locationPolicy }}"
}';