Skip to main content

capacity_reservations

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

Overview

Namecapacity_reservations
TypeResource
Idazure.compute.capacity_reservations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource Id
namestringResource name
locationstringResource location
propertiesobjectProperties of the Capacity reservation.
skuobjectSKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
tagsobjectResource tags
typestringResource type
zonesarrayAvailability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. The zone can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, capacityReservationGroupName, capacityReservationName, subscriptionId$expandThe operation that retrieves information about the capacity reservation.
list_by_capacity_reservation_groupselectresourceGroupName, capacityReservationGroupName, subscriptionIdLists all of the capacity reservations in the specified capacity reservation group. Use the nextLink property in the response to get the next page of capacity reservations.
create_or_updateinsertresourceGroupName, capacityReservationGroupName, capacityReservationName, subscriptionId, data__skuThe operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details.
updateupdateresourceGroupName, capacityReservationGroupName, capacityReservationName, subscriptionIdThe operation to update a capacity reservation.
deletedeleteresourceGroupName, capacityReservationGroupName, capacityReservationName, subscriptionIdThe operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. 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.
capacityReservationNamestringThe name of the capacity reservation.
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. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.

SELECT examples

The operation that retrieves information about the capacity reservation.

SELECT
id,
name,
location,
properties,
sku,
tags,
type,
zones
FROM azure.compute.capacity_reservations
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND capacityReservationGroupName = '{{ capacityReservationGroupName }}' -- required
AND capacityReservationName = '{{ capacityReservationName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

The operation to create or update a capacity reservation. Please note some properties can be set only during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details.

INSERT INTO azure.compute.capacity_reservations (
data__properties,
data__sku,
data__zones,
data__location,
data__tags,
resourceGroupName,
capacityReservationGroupName,
capacityReservationName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ sku }}' /* required */,
'{{ zones }}',
'{{ location }}',
'{{ tags }}',
'{{ resourceGroupName }}',
'{{ capacityReservationGroupName }}',
'{{ capacityReservationName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
location,
properties,
sku,
tags,
type,
zones
;

UPDATE examples

The operation to update a capacity reservation.

UPDATE azure.compute.capacity_reservations
SET
data__properties = '{{ properties }}',
data__sku = '{{ sku }}',
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND capacityReservationGroupName = '{{ capacityReservationGroupName }}' --required
AND capacityReservationName = '{{ capacityReservationName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
id,
name,
location,
properties,
sku,
tags,
type,
zones;

DELETE examples

The operation to delete a capacity reservation. This operation is allowed only when all the associated resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for more details.

DELETE FROM azure.compute.capacity_reservations
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND capacityReservationGroupName = '{{ capacityReservationGroupName }}' --required
AND capacityReservationName = '{{ capacityReservationName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;