v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-131,0021,0174.3 MB
instances

Sets an instance's scheduling options. You can only call this method on astopped instance, that is, a VM instance that is in a TERMINATED state. SeeInstance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, seeSet VM host maintenance policy.

post/projects/{project}/zones/{zone}/instances/{instance}/setScheduling

Path parameters

projectstring required

Project ID for this request.

zonestring required

The name of the zone for this request.

instancestring required

Instance name for this request.

Query parameters

requestIdstring

An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.

For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Request body

locationHintstring

An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API.

skipGuestOsShutdownboolean

Default is false and there will be 120 seconds between GCE ACPI G2 Soft Off and ACPI G3 Mechanical Off for Standard VMs and 30 seconds for Spot VMs.

minNodeCpusinteger

The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node.

onHostMaintenance'MIGRATE' | 'TERMINATE'

Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. Forpreemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy.

provisioningModel'FLEX_START' | 'RESERVATION_BOUND' | 'SPOT' | 'STANDARD'

Specifies the provisioning model of the instance.

terminationTimestring

Specifies the timestamp, when the instance will be terminated, inRFC3339 text format. If specified, the instance termination action will be performed at the termination time.

instanceTerminationAction'DELETE' | 'INSTANCE_TERMINATION_ACTION_UNSPECIFIED' | 'STOP'

Specifies the termination action for the instance.

hostErrorTimeoutSecondsinteger

Specify the time in seconds for host error detection, the value must be within the range of [90, 330] with the increment of 30, if unset, the default behavior of host error recovery will be used.

automaticRestartboolean

Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances.Preemptible instances cannot be automatically restarted.

By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine.

preemptibleboolean

Defines whether the instance is preemptible. This can only be set during instance creation or while the instance isstopped and therefore, in a TERMINATED state. SeeInstance Life Cycle for more information on the possible instance states.

availabilityDomaininteger

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.

Response

Successful response