Partager via


CapacityReservationGroupInner Class

public final class CapacityReservationGroupInner
extends 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

Constructor Description
CapacityReservationGroupInner()

Creates an instance of CapacityReservationGroupInner class.

Method Summary

Modifier and Type Method and Description
List<SubResourceReadOnly> capacityReservations()

Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity reservation group.

static CapacityReservationGroupInner fromJson(JsonReader jsonReader)

Reads an instance of CapacityReservationGroupInner from the JsonReader.

String id()

Get the id property: Fully qualified resource Id for the resource.

CapacityReservationGroupInstanceView 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.

String name()

Get the name property: The name of the resource.

ResourceSharingProfile sharingProfile()

Get the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource.

JsonWriter toJson(JsonWriter jsonWriter)
String type()

Get the type property: The type of the resource.

void validate()

Validates the instance.

List<SubResourceReadOnly> virtualMachinesAssociated()

Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the capacity reservation group.

CapacityReservationGroupInner withLocation(String location)
CapacityReservationGroupInner withSharingProfile(ResourceSharingProfile sharingProfile)

Set the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource.

CapacityReservationGroupInner withTags(Map<String,String> tags)
CapacityReservationGroupInner withZones(List<String> zones)

Set the zones property: Availability Zones to use for this capacity reservation group.

List<String> zones()

Get the zones property: Availability Zones to use for this capacity reservation group.

Methods inherited from ProxyResource

Methods inherited from Resource

Methods inherited from java.lang.Object

Constructor Details

CapacityReservationGroupInner

public CapacityReservationGroupInner()

Creates an instance of CapacityReservationGroupInner class.

Method Details

capacityReservations

public List capacityReservations()

Get the capacityReservations property: A list of all capacity reservation resource ids that belong to capacity reservation group.

Returns:

the capacityReservations value.

fromJson

public static CapacityReservationGroupInner fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

id

public String id()

Get the id property: Fully qualified resource Id for the resource.

Overrides:

CapacityReservationGroupInner.id()

Returns:

the id value.

instanceView

public CapacityReservationGroupInstanceView 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.

name

public String name()

Get the name property: The name of the resource.

Overrides:

CapacityReservationGroupInner.name()

Returns:

the name value.

sharingProfile

public ResourceSharingProfile sharingProfile()

Get the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details.

Returns:

the sharingProfile value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

CapacityReservationGroupInner.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public String type()

Get the type property: The type of the resource.

Overrides:

CapacityReservationGroupInner.type()

Returns:

the type value.

validate

public void validate()

Validates the instance.

virtualMachinesAssociated

public List virtualMachinesAssociated()

Get the virtualMachinesAssociated property: A list of references to all virtual machines associated to the capacity reservation group.

Returns:

the virtualMachinesAssociated value.

withLocation

public CapacityReservationGroupInner withLocation(String location)

Overrides:

CapacityReservationGroupInner.withLocation(String location)

Parameters:

location

withSharingProfile

public CapacityReservationGroupInner withSharingProfile(ResourceSharingProfile sharingProfile)

Set the sharingProfile property: Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **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.

withTags

public CapacityReservationGroupInner withTags(Map tags)

Overrides:

CapacityReservationGroupInner.withTags(Map<String,String> tags)

Parameters:

tags

withZones

public CapacityReservationGroupInner withZones(List zones)

Set the zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, the group supports only regional resources in the region. If provided, enforces each capacity reservation in the group to be in one of the zones.

Parameters:

zones - the zones value to set.

Returns:

the CapacityReservationGroupInner object itself.

zones

public List zones()

Get the zones property: Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, the group supports only regional resources in the region. If provided, enforces each capacity reservation in the group to be in one of the zones.

Returns:

the zones value.

Applies to