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
idstringResource Id
namestringResource name
locationstringResource location
propertiesobjectcapacity reservation group Properties.
tagsobjectResource tags
typestringResource type
zonesarrayAvailability 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, capacityReservationGroupName, subscriptionId$expandThe operation that retrieves information about a capacity reservation group.
list_by_resource_groupselectresourceGroupName, subscriptionId$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_subscriptionselectsubscriptionId$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_updateinsertresourceGroupName, capacityReservationGroupName, subscriptionIdThe 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.
updateupdateresourceGroupName, capacityReservationGroupName, subscriptionIdThe operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified.
deletedeleteresourceGroupName, capacityReservationGroupName, subscriptionIdThe 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
capacityReservationGroupNamestringThe name of the capacity reservation group.
resourceGroupNamestringThe name of the resource group.
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
$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.
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.

SELECT examples

The operation that retrieves information about a capacity reservation group.

SELECT
id,
name,
location,
properties,
tags,
type,
zones
FROM azure.compute.capacity_reservation_groups
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND capacityReservationGroupName = '{{ capacityReservationGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- 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 (
data__properties,
data__zones,
data__location,
data__tags,
resourceGroupName,
capacityReservationGroupName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ zones }}',
'{{ location }}',
'{{ tags }}',
'{{ resourceGroupName }}',
'{{ capacityReservationGroupName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
location,
properties,
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
data__properties = '{{ properties }}',
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND capacityReservationGroupName = '{{ capacityReservationGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
id,
name,
location,
properties,
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 resourceGroupName = '{{ resourceGroupName }}' --required
AND capacityReservationGroupName = '{{ capacityReservationGroupName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;