Compute V1 Client - Class Scheduling (1.5.0)

Reference documentation and code samples for the Compute V1 Client class Scheduling.

Sets the scheduling options for an Instance.

Generated from protobuf message google.cloud.compute.v1.Scheduling

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ automatic_restart bool

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.

↳ instance_termination_action string

Specifies the termination action for the instance. Check the InstanceTerminationAction enum for the list of possible values.

↳ location_hint string

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.

↳ min_node_cpus int

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

↳ node_affinities array<Google\Cloud\Compute\V1\SchedulingNodeAffinity>

A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity.

↳ on_host_maintenance string

Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Set VM host maintenance policy. Check the OnHostMaintenance enum for the list of possible values.

↳ preemptible bool

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

↳ provisioning_model string

Specifies the provisioning model of the instance. Check the ProvisioningModel enum for the list of possible values.

getAutomaticRestart

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.

Generated from protobuf field optional bool automatic_restart = 350821371;

Returns
TypeDescription
bool

hasAutomaticRestart

clearAutomaticRestart

setAutomaticRestart

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.

Generated from protobuf field optional bool automatic_restart = 350821371;

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getInstanceTerminationAction

Specifies the termination action for the instance.

Check the InstanceTerminationAction enum for the list of possible values.

Generated from protobuf field optional string instance_termination_action = 107380667;

Returns
TypeDescription
string

hasInstanceTerminationAction

clearInstanceTerminationAction

setInstanceTerminationAction

Specifies the termination action for the instance.

Check the InstanceTerminationAction enum for the list of possible values.

Generated from protobuf field optional string instance_termination_action = 107380667;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getLocationHint

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.

Generated from protobuf field optional string location_hint = 350519505;

Returns
TypeDescription
string

hasLocationHint

clearLocationHint

setLocationHint

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.

Generated from protobuf field optional string location_hint = 350519505;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getMinNodeCpus

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

Generated from protobuf field optional int32 min_node_cpus = 317231675;

Returns
TypeDescription
int

hasMinNodeCpus

clearMinNodeCpus

setMinNodeCpus

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

Generated from protobuf field optional int32 min_node_cpus = 317231675;

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getNodeAffinities

A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity.

Generated from protobuf field repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setNodeAffinities

A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity.

Generated from protobuf field repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
var array<Google\Cloud\Compute\V1\SchedulingNodeAffinity>
Returns
TypeDescription
$this

getOnHostMaintenance

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

Check the OnHostMaintenance enum for the list of possible values.

Generated from protobuf field optional string on_host_maintenance = 64616796;

Returns
TypeDescription
string

hasOnHostMaintenance

clearOnHostMaintenance

setOnHostMaintenance

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

Check the OnHostMaintenance enum for the list of possible values.

Generated from protobuf field optional string on_host_maintenance = 64616796;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getPreemptible

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

Generated from protobuf field optional bool preemptible = 324203169;

Returns
TypeDescription
bool

hasPreemptible

clearPreemptible

setPreemptible

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

Generated from protobuf field optional bool preemptible = 324203169;

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getProvisioningModel

Specifies the provisioning model of the instance.

Check the ProvisioningModel enum for the list of possible values.

Generated from protobuf field optional string provisioning_model = 494423;

Returns
TypeDescription
string

hasProvisioningModel

clearProvisioningModel

setProvisioningModel

Specifies the provisioning model of the instance.

Check the ProvisioningModel enum for the list of possible values.

Generated from protobuf field optional string provisioning_model = 494423;

Parameter
NameDescription
var string
Returns
TypeDescription
$this