Skip to main content

capacity_reservation_groups

Creates, updates, deletes, gets or lists a capacity_reservation_groups resource.

Overview

Namecapacity_reservation_groups
TypeResource
Idazure.compute.capacity_reservation_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
capacityReservationsarrayA list of all capacity reservation resource ids that belong to capacity reservation group.
instanceViewobjectThe capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group.
locationstringThe geo-location where the resource lives. Required.
reservationTypestringIndicates 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. Known values are: "Targeted" and "Block". (Targeted, Block)
sharingProfileobjectSpecifies 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.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
virtualMachinesAssociatedarrayA list of references to all virtual machines associated to the capacity reservation group.
zonesarrayThe availability zones.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, capacity_reservation_group_name, subscription_id$expandThe operation that retrieves information about a capacity reservation group.
list_by_resource_groupselectresource_group_name, subscription_id$expandLists all of the capacity reservation groups in the specified resource group. Use the nextLink property in the response to get the next page of capacity reservation groups.
list_by_subscriptionselectsubscription_id$expand, resourceIdsOnlyLists all of the capacity reservation groups in the subscription. Use the nextLink property in the response to get the next page of capacity reservation groups.
create_or_updateinsertresource_group_name, capacity_reservation_group_name, subscription_id, locationThe operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation _ for more details.
updateupdateresource_group_name, capacity_reservation_group_name, subscription_idThe operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified.
create_or_updatereplaceresource_group_name, capacity_reservation_group_name, subscription_id, locationThe operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation _ for more details.
deletedeleteresource_group_name, capacity_reservation_group_name, subscription_idThe operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation _ for more details.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
capacity_reservation_group_namestringThe name of the capacity reservation group. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
$expandstringThe expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation group in the response. Known values are: "virtualMachineScaleSetVMs/$ref" and "virtualMachines/$ref". Default value is None.
resourceIdsOnlystringThe query option to fetch Capacity Reservation Group Resource Ids. 'CreatedInSubscription' enables fetching Resource Ids for all capacity reservation group resources created in the subscription. 'SharedWithSubscription' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription. 'All' enables fetching Resource Ids for all capacity reservation group resources shared with the subscription and created in the subscription. Known values are: "CreatedInSubscription", "SharedWithSubscription", and "All". Default value is None.

SELECT examples

The operation that retrieves information about a capacity reservation group.

SELECT
id,
name,
capacityReservations,
instanceView,
location,
reservationType,
sharingProfile,
systemData,
tags,
type,
virtualMachinesAssociated,
zones
FROM azure.compute.capacity_reservation_groups
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND capacity_reservation_group_name = '{{ capacity_reservation_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation _ for more details.

INSERT INTO azure.compute.capacity_reservation_groups (
tags,
location,
properties,
zones,
resource_group_name,
capacity_reservation_group_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ zones }}',
'{{ resource_group_name }}',
'{{ capacity_reservation_group_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type,
zones
;

UPDATE examples

The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified.

UPDATE azure.compute.capacity_reservation_groups
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND capacity_reservation_group_name = '{{ capacity_reservation_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type,
zones;

REPLACE examples

The operation to create or update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. Please refer to https://aka.ms/CapacityReservation _ for more details.

REPLACE azure.compute.capacity_reservation_groups
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
zones = '{{ zones }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND capacity_reservation_group_name = '{{ capacity_reservation_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type,
zones;

DELETE examples

The operation to delete a capacity reservation group. This operation is allowed only if all the associated resources are disassociated from the reservation group and all capacity reservations under the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation _ for more details.

DELETE FROM azure.compute.capacity_reservation_groups
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND capacity_reservation_group_name = '{{ capacity_reservation_group_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;