Class CapacityReservationInner
java.lang.Object
com.azure.core.management.ProxyResource
com.azure.core.management.Resource
com.azure.resourcemanager.compute.fluent.models.CapacityReservationInner
- All Implemented Interfaces:
com.azure.json.JsonSerializable<com.azure.core.management.ProxyResource>
public final class CapacityReservationInner
extends com.azure.core.management.Resource
Specifies information about the capacity reservation.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of CapacityReservationInner class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CapacityReservationInnerfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CapacityReservationInner from the JsonReader.id()Get the id property: Fully qualified resource Id for the resource.Get the instanceView property: The Capacity reservation instance view.name()Get the name property: The name of the resource.Get the platformFaultDomainCount property: Specifies the value of fault domain count that Capacity Reservation supports for requested VM size.Get the provisioningState property: The provisioning state, which only appears in the response.Get the provisioningTime property: The date time when the capacity reservation was last updated.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.Get the scheduleProfile property: Defines the schedule for Block-type capacity reservations.sku()Get the sku property: SKU of the resource for which capacity needs be reserved.com.azure.core.management.SystemDataGet the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.Get the timeCreated property: Specifies the time at which the Capacity Reservation resource was created.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) type()Get the type property: The type of the resource.voidvalidate()Validates the instance.Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with the capacity reservation.withLocation(String location) withScheduleProfile(ScheduleProfile scheduleProfile) Set the scheduleProfile property: Defines the schedule for Block-type capacity reservations.Set the sku property: SKU of the resource for which capacity needs be reserved.Set the zones property: The availability zones.zones()Get the zones property: The availability zones.Methods inherited from class com.azure.core.management.Resource
location, tagsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CapacityReservationInner
public CapacityReservationInner()Creates an instance of CapacityReservationInner class.
-
-
Method Details
-
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. For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. 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.- Returns:
- the sku value.
-
withSku
Set the sku property: SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. 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.- Parameters:
sku- the sku value to set.- Returns:
- the CapacityReservationInner object itself.
-
zones
-
withZones
Set the zones property: The availability zones.- Parameters:
zones- the zones value to set.- Returns:
- the CapacityReservationInner object itself.
-
systemData
public com.azure.core.management.SystemData systemData()Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.- Returns:
- the systemData value.
-
type
Get the type property: The type of the resource.- Overrides:
typein classcom.azure.core.management.ProxyResource- Returns:
- the type value.
-
name
Get the name property: The name of the resource.- Overrides:
namein classcom.azure.core.management.ProxyResource- Returns:
- the name value.
-
id
Get the id property: Fully qualified resource Id for the resource.- Overrides:
idin classcom.azure.core.management.ProxyResource- Returns:
- the id value.
-
withLocation
- Overrides:
withLocationin classcom.azure.core.management.Resource
-
withTags
- Overrides:
withTagsin classcom.azure.core.management.Resource
-
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
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
Get the virtualMachinesAssociated property: A list of all virtual machine resource ids that are associated with the capacity reservation.- Returns:
- the virtualMachinesAssociated value.
-
provisioningTime
Get the provisioningTime property: The date time when the capacity reservation was last updated.- Returns:
- the provisioningTime value.
-
provisioningState
Get the provisioningState property: The provisioning state, which only appears in the response.- Returns:
- the provisioningState value.
-
instanceView
Get the instanceView property: The Capacity reservation instance view.- Returns:
- the instanceView value.
-
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
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
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 CapacityReservationInner object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<com.azure.core.management.ProxyResource>- Overrides:
toJsonin classcom.azure.core.management.Resource- Throws:
IOException
-
fromJson
public static CapacityReservationInner fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of CapacityReservationInner from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CapacityReservationInner if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the CapacityReservationInner.
-