ScaleInPolicy Class

  • java.lang.Object
    • com.azure.resourcemanager.compute.models.ScaleInPolicy

Implements

public final class ScaleInPolicy
implements JsonSerializable<ScaleInPolicy>

Describes a scale-in policy for a virtual machine scale set.

Constructor Summary

Constructor Description
ScaleInPolicy()

Creates an instance of ScaleInPolicy class.

Method Summary

Modifier and Type Method and Description
Boolean forceDeletion()

Get the forceDeletion property: This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview).

static ScaleInPolicy fromJson(JsonReader jsonReader)

Reads an instance of ScaleInPolicy from the JsonReader.

List<VirtualMachineScaleSetScaleInRules> rules()

Get the rules property: The rules to be followed when scaling-in a virtual machine scale set.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

ScaleInPolicy withForceDeletion(Boolean forceDeletion)

Set the forceDeletion property: This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview).

ScaleInPolicy withRules(List<VirtualMachineScaleSetScaleInRules> rules)

Set the rules property: The rules to be followed when scaling-in a virtual machine scale set.

Methods inherited from java.lang.Object

Constructor Details

ScaleInPolicy

public ScaleInPolicy()

Creates an instance of ScaleInPolicy class.

Method Details

forceDeletion

public Boolean forceDeletion()

Get the forceDeletion property: This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview).

Returns:

the forceDeletion value.

fromJson

public static ScaleInPolicy fromJson(JsonReader jsonReader)

Reads an instance of ScaleInPolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ScaleInPolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the ScaleInPolicy.

rules

public List rules()

Get the rules property: The rules to be followed when scaling-in a virtual machine scale set.

Possible values are:

**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

.

Returns:

the rules value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withForceDeletion

public ScaleInPolicy withForceDeletion(Boolean forceDeletion)

Set the forceDeletion property: This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview).

Parameters:

forceDeletion - the forceDeletion value to set.

Returns:

the ScaleInPolicy object itself.

withRules

public ScaleInPolicy withRules(List rules)

Set the rules property: The rules to be followed when scaling-in a virtual machine scale set.

Possible values are:

**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

.

Parameters:

rules - the rules value to set.

Returns:

the ScaleInPolicy object itself.

Applies to