Class CapacityReservationUpdate

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

public final class CapacityReservationUpdate extends UpdateResource
Specifies information about the capacity reservation. sku.capacity cannot be updated for Block Capacity Reservation. Tags can be update for all Capacity Reservation Types.
  • Constructor Details

    • CapacityReservationUpdate

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

    • sku

      public Sku sku()
      Get the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. **Note:** The SKU name and capacity cannot be updated for Block capacity reservations.
      Returns:
      the sku value.
    • withSku

      public CapacityReservationUpdate withSku(Sku sku)
      Set the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. **Note:** The SKU name and capacity cannot be updated for Block capacity reservations.
      Parameters:
      sku - the sku value to set.
      Returns:
      the CapacityReservationUpdate object itself.
    • withTags

      public CapacityReservationUpdate withTags(Map<String,String> tags)
      Set the tags property: Resource tags.
      Overrides:
      withTags in class UpdateResource
      Parameters:
      tags - the tags value to set.
      Returns:
      the UpdateResource object itself.
    • reservationId

      public String reservationId()
      Get the reservationId property: A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
      Returns:
      the reservationId value.
    • platformFaultDomainCount

      public Integer platformFaultDomainCount()
      Get the platformFaultDomainCount property: Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. **Note:** The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
      Returns:
      the platformFaultDomainCount value.
    • virtualMachinesAssociated

      public List<SubResourceReadOnly> virtualMachinesAssociated()
      Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with the capacity reservation.
      Returns:
      the virtualMachinesAssociated value.
    • provisioningTime

      public OffsetDateTime provisioningTime()
      Get the provisioningTime property: The date time when the capacity reservation was last updated.
      Returns:
      the provisioningTime value.
    • provisioningState

      public String provisioningState()
      Get the provisioningState property: The provisioning state, which only appears in the response.
      Returns:
      the provisioningState value.
    • instanceView

      public CapacityReservationInstanceView instanceView()
      Get the instanceView property: The Capacity reservation instance view.
      Returns:
      the instanceView value.
    • timeCreated

      public OffsetDateTime timeCreated()
      Get the timeCreated property: Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
      Returns:
      the timeCreated value.
    • scheduleProfile

      public ScheduleProfile scheduleProfile()
      Get the scheduleProfile property: Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details.
      Returns:
      the scheduleProfile value.
    • withScheduleProfile

      public CapacityReservationUpdate withScheduleProfile(ScheduleProfile scheduleProfile)
      Set the scheduleProfile property: Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details.
      Parameters:
      scheduleProfile - the scheduleProfile value to set.
      Returns:
      the CapacityReservationUpdate object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class UpdateResource
      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<UpdateResource>
      Overrides:
      toJson in class UpdateResource
      Throws:
      IOException
    • fromJson

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