Class CapacityReservationGroupInner
java.lang.Object
com.azure.core.management.ProxyResource
com.azure.core.management.Resource
com.azure.resourcemanager.compute.fluent.models.CapacityReservationGroupInner
- All Implemented Interfaces:
com.azure.json.JsonSerializable<com.azure.core.management.ProxyResource>
public final class CapacityReservationGroupInner
extends com.azure.core.management.Resource
Specifies information about the capacity reservation group that the capacity reservations should be assigned to.
Currently, a capacity reservation can only be added to a capacity reservation group at creation time. An existing
capacity reservation cannot be added or moved to another capacity reservation group.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of CapacityReservationGroupInner class. -
Method Summary
Modifier and TypeMethodDescriptionGet the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity reservation group.fromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CapacityReservationGroupInner from the JsonReader.id()Get the id property: Fully qualified resource Id for the resource.Get the instanceView property: The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group.name()Get the name property: The name of the resource.Get the reservationType property: Indicates the type of capacity reservation.Get the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource.com.azure.core.management.SystemDataGet the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.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 references to all virtual machines associated to the capacity reservation group.withLocation(String location) withReservationType(ReservationType reservationType) Set the reservationType property: Indicates the type of capacity reservation.withSharingProfile(ResourceSharingProfile sharingProfile) Set the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource.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
-
CapacityReservationGroupInner
public CapacityReservationGroupInner()Creates an instance of CapacityReservationGroupInner class.
-
-
Method Details
-
zones
-
withZones
Set the zones property: The availability zones.- Parameters:
zones- the zones value to set.- Returns:
- the CapacityReservationGroupInner 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
-
capacityReservations
Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity reservation group.- Returns:
- the capacityReservations value.
-
virtualMachinesAssociated
Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the capacity reservation group.- Returns:
- the virtualMachinesAssociated value.
-
instanceView
Get the instanceView property: The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group.- Returns:
- the instanceView value.
-
sharingProfile
Get the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details.- Returns:
- the sharingProfile value.
-
withSharingProfile
Set the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details.- Parameters:
sharingProfile- the sharingProfile value to set.- Returns:
- the CapacityReservationGroupInner object itself.
-
reservationType
Get the reservationType property: Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned.- Returns:
- the reservationType value.
-
withReservationType
Set the reservationType property: Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned.- Parameters:
reservationType- the reservationType value to set.- Returns:
- the CapacityReservationGroupInner 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 CapacityReservationGroupInner fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of CapacityReservationGroupInner from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CapacityReservationGroupInner 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 CapacityReservationGroupInner.
-