UpgradePolicy Class

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

Implements

public final class UpgradePolicy
implements JsonSerializable<UpgradePolicy>

Describes an upgrade policy - automatic, manual, or rolling.

Constructor Summary

Constructor Description
UpgradePolicy()

Creates an instance of UpgradePolicy class.

Method Summary

Modifier and Type Method and Description
AutomaticOSUpgradePolicy automaticOSUpgradePolicy()

Get the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.

static UpgradePolicy fromJson(JsonReader jsonReader)

Reads an instance of UpgradePolicy from the JsonReader.

UpgradeMode mode()

Get the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set.

RollingUpgradePolicy rollingUpgradePolicy()

Get the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

UpgradePolicy withAutomaticOSUpgradePolicy(AutomaticOSUpgradePolicy automaticOSUpgradePolicy)

Set the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.

UpgradePolicy withMode(UpgradeMode mode)

Set the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set.

UpgradePolicy withRollingUpgradePolicy(RollingUpgradePolicy rollingUpgradePolicy)

Set the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.

Methods inherited from java.lang.Object

Constructor Details

UpgradePolicy

public UpgradePolicy()

Creates an instance of UpgradePolicy class.

Method Details

automaticOSUpgradePolicy

public AutomaticOSUpgradePolicy automaticOSUpgradePolicy()

Get the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.

Returns:

the automaticOSUpgradePolicy value.

fromJson

public static UpgradePolicy fromJson(JsonReader jsonReader)

Reads an instance of UpgradePolicy from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of UpgradePolicy 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 UpgradePolicy.

mode

public UpgradeMode mode()

Get the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time.

Returns:

the mode value.

rollingUpgradePolicy

public RollingUpgradePolicy rollingUpgradePolicy()

Get the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.

Returns:

the rollingUpgradePolicy value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withAutomaticOSUpgradePolicy

public UpgradePolicy withAutomaticOSUpgradePolicy(AutomaticOSUpgradePolicy automaticOSUpgradePolicy)

Set the automaticOSUpgradePolicy property: Configuration parameters used for performing automatic OS Upgrade.

Parameters:

automaticOSUpgradePolicy - the automaticOSUpgradePolicy value to set.

Returns:

the UpgradePolicy object itself.

withMode

public UpgradePolicy withMode(UpgradeMode mode)

Set the mode property: Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time.

Parameters:

mode - the mode value to set.

Returns:

the UpgradePolicy object itself.

withRollingUpgradePolicy

public UpgradePolicy withRollingUpgradePolicy(RollingUpgradePolicy rollingUpgradePolicy)

Set the rollingUpgradePolicy property: The configuration parameters used while performing a rolling upgrade.

Parameters:

rollingUpgradePolicy - the rollingUpgradePolicy value to set.

Returns:

the UpgradePolicy object itself.

Applies to