capacity_reservations
Creates, updates, deletes, gets or lists a capacity_reservations
resource.
Overview
Name | capacity_reservations |
Type | Resource |
Id | azure.compute.capacity_reservations |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_capacity_reservation_group
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
location | string | Resource location |
properties | object | Properties of the Capacity reservation. |
sku | object | SKU 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. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | Availability 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. |
Name | Datatype | Description |
---|---|---|
id | string | Resource Id |
name | string | Resource name |
location | string | Resource location |
properties | object | Properties of the Capacity reservation. |
sku | object | SKU 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. |
tags | object | Resource tags |
type | string | Resource type |
zones | array | Availability 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceGroupName , capacityReservationGroupName , capacityReservationName , subscriptionId | $expand | The operation that retrieves information about the capacity reservation. |
list_by_capacity_reservation_group | select | resourceGroupName , capacityReservationGroupName , subscriptionId | 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. | |
create_or_update | insert | resourceGroupName , capacityReservationGroupName , capacityReservationName , subscriptionId , data__sku | 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. | |
update | update | resourceGroupName , capacityReservationGroupName , capacityReservationName , subscriptionId | The operation to update a capacity reservation. | |
delete | delete | resourceGroupName , capacityReservationGroupName , capacityReservationName , subscriptionId | 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. |
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.
Name | Datatype | Description |
---|---|---|
capacityReservationGroupName | string | The name of the capacity reservation group. |
capacityReservationName | string | The name of the capacity reservation. |
resourceGroupName | string | The name of the resource group. |
subscriptionId | string | Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
$expand | string | The 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
- get
- list_by_capacity_reservation_group
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 }}'
;
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,
location,
properties,
sku,
tags,
type,
zones
FROM azure.compute.capacity_reservations
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND capacityReservationGroupName = '{{ capacityReservationGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: capacity_reservations
props:
- name: resourceGroupName
value: string
description: Required parameter for the capacity_reservations resource.
- name: capacityReservationGroupName
value: string
description: Required parameter for the capacity_reservations resource.
- name: capacityReservationName
value: string
description: Required parameter for the capacity_reservations resource.
- name: subscriptionId
value: string
description: Required parameter for the capacity_reservations resource.
- name: properties
value: object
description: |
Properties of the Capacity reservation.
- name: sku
value: object
description: |
SKU 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.
- name: zones
value: array
description: |
Availability 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.
- name: location
value: string
description: |
Resource location
- name: tags
value: object
description: |
Resource tags
UPDATE
examples
- update
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
- delete
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
;