Class Scheduling.Builder (1.24.0)

public static final class Scheduling.Builder extends GeneratedMessageV3.Builder<Scheduling.Builder> implements SchedulingOrBuilder

Sets the scheduling options for an Instance.

Protobuf type google.cloud.compute.v1.Scheduling

Implements

SchedulingOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllNodeAffinities(Iterable<? extends SchedulingNodeAffinity> values)

public Scheduling.Builder addAllNodeAffinities(Iterable<? extends SchedulingNodeAffinity> values)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.compute.v1.SchedulingNodeAffinity>
Returns
TypeDescription
Scheduling.Builder

addNodeAffinities(SchedulingNodeAffinity value)

public Scheduling.Builder addNodeAffinities(SchedulingNodeAffinity value)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
valueSchedulingNodeAffinity
Returns
TypeDescription
Scheduling.Builder

addNodeAffinities(SchedulingNodeAffinity.Builder builderForValue)

public Scheduling.Builder addNodeAffinities(SchedulingNodeAffinity.Builder builderForValue)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
builderForValueSchedulingNodeAffinity.Builder
Returns
TypeDescription
Scheduling.Builder

addNodeAffinities(int index, SchedulingNodeAffinity value)

public Scheduling.Builder addNodeAffinities(int index, SchedulingNodeAffinity value)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameters
NameDescription
indexint
valueSchedulingNodeAffinity
Returns
TypeDescription
Scheduling.Builder

addNodeAffinities(int index, SchedulingNodeAffinity.Builder builderForValue)

public Scheduling.Builder addNodeAffinities(int index, SchedulingNodeAffinity.Builder builderForValue)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameters
NameDescription
indexint
builderForValueSchedulingNodeAffinity.Builder
Returns
TypeDescription
Scheduling.Builder

addNodeAffinitiesBuilder()

public SchedulingNodeAffinity.Builder addNodeAffinitiesBuilder()

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Returns
TypeDescription
SchedulingNodeAffinity.Builder

addNodeAffinitiesBuilder(int index)

public SchedulingNodeAffinity.Builder addNodeAffinitiesBuilder(int index)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
indexint
Returns
TypeDescription
SchedulingNodeAffinity.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Scheduling.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Scheduling.Builder
Overrides

build()

public Scheduling build()
Returns
TypeDescription
Scheduling

buildPartial()

public Scheduling buildPartial()
Returns
TypeDescription
Scheduling

clear()

public Scheduling.Builder clear()
Returns
TypeDescription
Scheduling.Builder
Overrides

clearAutomaticRestart()

public Scheduling.Builder clearAutomaticRestart()

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.

optional bool automatic_restart = 350821371;

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Scheduling.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Scheduling.Builder
Overrides

clearInstanceTerminationAction()

public Scheduling.Builder clearInstanceTerminationAction()

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

optional string instance_termination_action = 107380667;

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

clearLocationHint()

public Scheduling.Builder clearLocationHint()

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.

optional string location_hint = 350519505;

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

clearMinNodeCpus()

public Scheduling.Builder clearMinNodeCpus()

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

optional int32 min_node_cpus = 317231675;

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

clearNodeAffinities()

public Scheduling.Builder clearNodeAffinities()

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Returns
TypeDescription
Scheduling.Builder

clearOnHostMaintenance()

public Scheduling.Builder clearOnHostMaintenance()

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.

optional string on_host_maintenance = 64616796;

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Scheduling.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Scheduling.Builder
Overrides

clearPreemptible()

public Scheduling.Builder clearPreemptible()

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.

optional bool preemptible = 324203169;

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

clearProvisioningModel()

public Scheduling.Builder clearProvisioningModel()

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

optional string provisioning_model = 494423;

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

clone()

public Scheduling.Builder clone()
Returns
TypeDescription
Scheduling.Builder
Overrides

getAutomaticRestart()

public boolean 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.

optional bool automatic_restart = 350821371;

Returns
TypeDescription
boolean

The automaticRestart.

getDefaultInstanceForType()

public Scheduling getDefaultInstanceForType()
Returns
TypeDescription
Scheduling

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getInstanceTerminationAction()

public String getInstanceTerminationAction()

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

optional string instance_termination_action = 107380667;

Returns
TypeDescription
String

The instanceTerminationAction.

getInstanceTerminationActionBytes()

public ByteString getInstanceTerminationActionBytes()

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

optional string instance_termination_action = 107380667;

Returns
TypeDescription
ByteString

The bytes for instanceTerminationAction.

getLocationHint()

public String 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.

optional string location_hint = 350519505;

Returns
TypeDescription
String

The locationHint.

getLocationHintBytes()

public ByteString getLocationHintBytes()

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.

optional string location_hint = 350519505;

Returns
TypeDescription
ByteString

The bytes for locationHint.

getMinNodeCpus()

public int getMinNodeCpus()

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

optional int32 min_node_cpus = 317231675;

Returns
TypeDescription
int

The minNodeCpus.

getNodeAffinities(int index)

public SchedulingNodeAffinity getNodeAffinities(int index)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
indexint
Returns
TypeDescription
SchedulingNodeAffinity

getNodeAffinitiesBuilder(int index)

public SchedulingNodeAffinity.Builder getNodeAffinitiesBuilder(int index)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
indexint
Returns
TypeDescription
SchedulingNodeAffinity.Builder

getNodeAffinitiesBuilderList()

public List<SchedulingNodeAffinity.Builder> getNodeAffinitiesBuilderList()

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Returns
TypeDescription
List<Builder>

getNodeAffinitiesCount()

public int getNodeAffinitiesCount()

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Returns
TypeDescription
int

getNodeAffinitiesList()

public List<SchedulingNodeAffinity> getNodeAffinitiesList()

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Returns
TypeDescription
List<SchedulingNodeAffinity>

getNodeAffinitiesOrBuilder(int index)

public SchedulingNodeAffinityOrBuilder getNodeAffinitiesOrBuilder(int index)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
indexint
Returns
TypeDescription
SchedulingNodeAffinityOrBuilder

getNodeAffinitiesOrBuilderList()

public List<? extends SchedulingNodeAffinityOrBuilder> getNodeAffinitiesOrBuilderList()

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Returns
TypeDescription
List<? extends com.google.cloud.compute.v1.SchedulingNodeAffinityOrBuilder>

getOnHostMaintenance()

public String 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.

optional string on_host_maintenance = 64616796;

Returns
TypeDescription
String

The onHostMaintenance.

getOnHostMaintenanceBytes()

public ByteString getOnHostMaintenanceBytes()

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.

optional string on_host_maintenance = 64616796;

Returns
TypeDescription
ByteString

The bytes for onHostMaintenance.

getPreemptible()

public boolean 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.

optional bool preemptible = 324203169;

Returns
TypeDescription
boolean

The preemptible.

getProvisioningModel()

public String getProvisioningModel()

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

optional string provisioning_model = 494423;

Returns
TypeDescription
String

The provisioningModel.

getProvisioningModelBytes()

public ByteString getProvisioningModelBytes()

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

optional string provisioning_model = 494423;

Returns
TypeDescription
ByteString

The bytes for provisioningModel.

hasAutomaticRestart()

public boolean hasAutomaticRestart()

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.

optional bool automatic_restart = 350821371;

Returns
TypeDescription
boolean

Whether the automaticRestart field is set.

hasInstanceTerminationAction()

public boolean hasInstanceTerminationAction()

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

optional string instance_termination_action = 107380667;

Returns
TypeDescription
boolean

Whether the instanceTerminationAction field is set.

hasLocationHint()

public boolean hasLocationHint()

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.

optional string location_hint = 350519505;

Returns
TypeDescription
boolean

Whether the locationHint field is set.

hasMinNodeCpus()

public boolean hasMinNodeCpus()

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

optional int32 min_node_cpus = 317231675;

Returns
TypeDescription
boolean

Whether the minNodeCpus field is set.

hasOnHostMaintenance()

public boolean hasOnHostMaintenance()

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.

optional string on_host_maintenance = 64616796;

Returns
TypeDescription
boolean

Whether the onHostMaintenance field is set.

hasPreemptible()

public boolean hasPreemptible()

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.

optional bool preemptible = 324203169;

Returns
TypeDescription
boolean

Whether the preemptible field is set.

hasProvisioningModel()

public boolean hasProvisioningModel()

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

optional string provisioning_model = 494423;

Returns
TypeDescription
boolean

Whether the provisioningModel field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Scheduling other)

public Scheduling.Builder mergeFrom(Scheduling other)
Parameter
NameDescription
otherScheduling
Returns
TypeDescription
Scheduling.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Scheduling.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Scheduling.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Scheduling.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Scheduling.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Scheduling.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Scheduling.Builder
Overrides

removeNodeAffinities(int index)

public Scheduling.Builder removeNodeAffinities(int index)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameter
NameDescription
indexint
Returns
TypeDescription
Scheduling.Builder

setAutomaticRestart(boolean value)

public Scheduling.Builder setAutomaticRestart(boolean value)

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.

optional bool automatic_restart = 350821371;

Parameter
NameDescription
valueboolean

The automaticRestart to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Scheduling.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Scheduling.Builder
Overrides

setInstanceTerminationAction(String value)

public Scheduling.Builder setInstanceTerminationAction(String value)

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

optional string instance_termination_action = 107380667;

Parameter
NameDescription
valueString

The instanceTerminationAction to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setInstanceTerminationActionBytes(ByteString value)

public Scheduling.Builder setInstanceTerminationActionBytes(ByteString value)

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

optional string instance_termination_action = 107380667;

Parameter
NameDescription
valueByteString

The bytes for instanceTerminationAction to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setLocationHint(String value)

public Scheduling.Builder setLocationHint(String value)

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.

optional string location_hint = 350519505;

Parameter
NameDescription
valueString

The locationHint to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setLocationHintBytes(ByteString value)

public Scheduling.Builder setLocationHintBytes(ByteString value)

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.

optional string location_hint = 350519505;

Parameter
NameDescription
valueByteString

The bytes for locationHint to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setMinNodeCpus(int value)

public Scheduling.Builder setMinNodeCpus(int value)

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

optional int32 min_node_cpus = 317231675;

Parameter
NameDescription
valueint

The minNodeCpus to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setNodeAffinities(int index, SchedulingNodeAffinity value)

public Scheduling.Builder setNodeAffinities(int index, SchedulingNodeAffinity value)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameters
NameDescription
indexint
valueSchedulingNodeAffinity
Returns
TypeDescription
Scheduling.Builder

setNodeAffinities(int index, SchedulingNodeAffinity.Builder builderForValue)

public Scheduling.Builder setNodeAffinities(int index, SchedulingNodeAffinity.Builder builderForValue)

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

repeated .google.cloud.compute.v1.SchedulingNodeAffinity node_affinities = 461799971;

Parameters
NameDescription
indexint
builderForValueSchedulingNodeAffinity.Builder
Returns
TypeDescription
Scheduling.Builder

setOnHostMaintenance(String value)

public Scheduling.Builder setOnHostMaintenance(String value)

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.

optional string on_host_maintenance = 64616796;

Parameter
NameDescription
valueString

The onHostMaintenance to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setOnHostMaintenanceBytes(ByteString value)

public Scheduling.Builder setOnHostMaintenanceBytes(ByteString value)

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.

optional string on_host_maintenance = 64616796;

Parameter
NameDescription
valueByteString

The bytes for onHostMaintenance to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setPreemptible(boolean value)

public Scheduling.Builder setPreemptible(boolean value)

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.

optional bool preemptible = 324203169;

Parameter
NameDescription
valueboolean

The preemptible to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setProvisioningModel(String value)

public Scheduling.Builder setProvisioningModel(String value)

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

optional string provisioning_model = 494423;

Parameter
NameDescription
valueString

The provisioningModel to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setProvisioningModelBytes(ByteString value)

public Scheduling.Builder setProvisioningModelBytes(ByteString value)

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

optional string provisioning_model = 494423;

Parameter
NameDescription
valueByteString

The bytes for provisioningModel to set.

Returns
TypeDescription
Scheduling.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Scheduling.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Scheduling.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Scheduling.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Scheduling.Builder
Overrides