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

NameDatatypeDescription
idtextResource Id
nametextResource name
capacityReservationGroupNametextfield from the properties object
capacityReservationNametextfield from the properties object
instance_viewtextfield from the properties object
locationtextResource location
platform_fault_domain_counttextfield from the properties object
provisioning_statetextfield from the properties object
provisioning_timetextfield from the properties object
reservation_idtextfield from the properties object
resourceGroupNametextfield from the properties object
skutextDescribes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.
subscriptionIdtextfield from the properties object
tagstextResource tags
time_createdtextfield from the properties object
typetextResource type
virtual_machines_associatedtextfield from the properties object
zonestextAvailability 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

NameAccessible byRequired ParamsDescription
getSELECTcapacityReservationGroupName, capacityReservationName, resourceGroupName, subscriptionIdThe operation that retrieves information about the capacity reservation.
list_by_capacity_reservation_groupSELECTcapacityReservationGroupName, resourceGroupName, 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_updateINSERTcapacityReservationGroupName, capacityReservationName, resourceGroupName, 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.
deleteDELETEcapacityReservationGroupName, capacityReservationName, resourceGroupName, 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.
updateUPDATEcapacityReservationGroupName, capacityReservationName, resourceGroupName, subscriptionIdThe operation to update a capacity reservation.

SELECT examples

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

SELECT
id,
name,
capacityReservationGroupName,
capacityReservationName,
instance_view,
location,
platform_fault_domain_count,
provisioning_state,
provisioning_time,
reservation_id,
resourceGroupName,
sku,
subscriptionId,
tags,
time_created,
type,
virtual_machines_associated,
zones
FROM azure.compute.vw_capacity_reservations
WHERE capacityReservationGroupName = '{{ capacityReservationGroupName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new capacity_reservations resource.

/*+ create */
INSERT INTO azure.compute.capacity_reservations (
capacityReservationGroupName,
capacityReservationName,
resourceGroupName,
subscriptionId,
data__sku,
properties,
sku,
zones,
location,
tags
)
SELECT
'{{ capacityReservationGroupName }}',
'{{ capacityReservationName }}',
'{{ resourceGroupName }}',
'{{ subscriptionId }}',
'{{ data__sku }}',
'{{ properties }}',
'{{ sku }}',
'{{ zones }}',
'{{ location }}',
'{{ tags }}'
;

UPDATE example

Updates a capacity_reservations resource.

/*+ update */
UPDATE azure.compute.capacity_reservations
SET
properties = '{{ properties }}',
sku = '{{ sku }}',
tags = '{{ tags }}'
WHERE
capacityReservationGroupName = '{{ capacityReservationGroupName }}'
AND capacityReservationName = '{{ capacityReservationName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified capacity_reservations resource.

/*+ delete */
DELETE FROM azure.compute.capacity_reservations
WHERE capacityReservationGroupName = '{{ capacityReservationGroupName }}'
AND capacityReservationName = '{{ capacityReservationName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND subscriptionId = '{{ subscriptionId }}';