Class Placement

java.lang.Object
com.azure.resourcemanager.compute.models.Placement
All Implemented Interfaces:
com.azure.json.JsonSerializable<Placement>

public final class Placement extends Object implements com.azure.json.JsonSerializable<Placement>
Describes the user-defined constraints for resource hardware placement.
  • Constructor Details

    • Placement

      public Placement()
      Creates an instance of Placement class.
  • Method Details

    • zonePlacementPolicy

      public ZonePlacementPolicyType zonePlacementPolicy()
      Get the zonePlacementPolicy property: Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation.
      Returns:
      the zonePlacementPolicy value.
    • withZonePlacementPolicy

      public Placement withZonePlacementPolicy(ZonePlacementPolicyType zonePlacementPolicy)
      Set the zonePlacementPolicy property: Specifies the policy for resource's placement in availability zone. Possible values are: **Any** (used for Virtual Machines), **Auto** (used for Virtual Machine Scale Sets) - An availability zone will be automatically picked by system as part of resource creation.
      Parameters:
      zonePlacementPolicy - the zonePlacementPolicy value to set.
      Returns:
      the Placement object itself.
    • includeZones

      public List<String> includeZones()
      Get the includeZones property: This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection.
      Returns:
      the includeZones value.
    • withIncludeZones

      public Placement withIncludeZones(List<String> includeZones)
      Set the includeZones property: This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must be present in the list of availability zones passed with 'includeZones'. If 'includeZones' is not provided, all availability zones in region will be considered for selection.
      Parameters:
      includeZones - the includeZones value to set.
      Returns:
      the Placement object itself.
    • excludeZones

      public List<String> excludeZones()
      Get the excludeZones property: This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection.
      Returns:
      the excludeZones value.
    • withExcludeZones

      public Placement withExcludeZones(List<String> excludeZones)
      Set the excludeZones property: This property supplements the 'zonePlacementPolicy' property. If 'zonePlacementPolicy' is set to 'Any'/'Auto', availability zone selected by the system must not be present in the list of availability zones passed with 'excludeZones'. If 'excludeZones' is not provided, all availability zones in region will be considered for selection.
      Parameters:
      excludeZones - the excludeZones value to set.
      Returns:
      the Placement object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<Placement>
      Throws:
      IOException
    • fromJson

      public static Placement fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of Placement from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of Placement 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 Placement.