Class Instance.Builder (6.58.0)

public static class Instance.Builder extends InstanceInfo.Builder

Builder of Instance.

Inheritance

java.lang.Object > InstanceInfo.Builder > Instance.Builder

Methods

addLabel(String key, String value)

public Instance.Builder addLabel(String key, String value)
Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
Instance.Builder
Overrides

build()

public Instance build()
Returns
TypeDescription
Instance
Overrides

putAllLabels(Map<String,String> labels)

public Instance.Builder putAllLabels(Map<String,String> labels)
Parameter
NameDescription
labelsMap<String,String>
Returns
TypeDescription
Instance.Builder
Overrides

setAutoscalingConfig(AutoscalingConfig autoscalingConfig)

public Instance.Builder setAutoscalingConfig(AutoscalingConfig autoscalingConfig)

Sets the autoscaling config for the instance, which will enable the autoscaling for this instance. Exactly one of processing units, node count, or autoscaling config must be set when creating a new instance.

Parameter
NameDescription
autoscalingConfigAutoscalingConfig
Returns
TypeDescription
Instance.Builder
Overrides

setDisplayName(String displayName)

public Instance.Builder setDisplayName(String displayName)
Parameter
NameDescription
displayNameString
Returns
TypeDescription
Instance.Builder
Overrides

setInstanceConfigId(InstanceConfigId instanceConfigId)

public Instance.Builder setInstanceConfigId(InstanceConfigId instanceConfigId)
Parameter
NameDescription
instanceConfigIdInstanceConfigId
Returns
TypeDescription
Instance.Builder
Overrides

setNodeCount(int nodeCount)

public Instance.Builder setNodeCount(int nodeCount)

Sets the number of nodes for the instance. Exactly one of processing units, node count or autoscaling config must be set when creating a new instance.

Parameter
NameDescription
nodeCountint
Returns
TypeDescription
Instance.Builder
Overrides

setProcessingUnits(int processingUnits)

public Instance.Builder setProcessingUnits(int processingUnits)

Sets the number of processing units for the instance. Exactly one of processing units, node count, or autoscaling config must be set when creating a new instance. Processing units must be between 1 and 999 (inclusive) when creating a new instance with node count = 0. Processing units from 1000 and up must always be a multiple of 1000 (that is equal to an integer number of nodes).

Parameter
NameDescription
processingUnitsint
Returns
TypeDescription
Instance.Builder
Overrides

setState(InstanceInfo.State state)

public Instance.Builder setState(InstanceInfo.State state)
Parameter
NameDescription
stateInstanceInfo.State
Returns
TypeDescription
Instance.Builder
Overrides