capacity_reservation_groups
Creates, updates, deletes, gets or lists a capacity_reservation_groups resource.
Overview
| Name | capacity_reservation_groups |
| Type | Resource |
| Id | azure.compute.capacity_reservation_groups |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- list_by_subscription
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
capacityReservations | array | A list of all capacity reservation resource ids that belong to capacity reservation group. |
instanceView | object | The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. |
location | string | The geo-location where the resource lives. Required. |
reservationType | string | Indicates 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) |
sharingProfile | object | Specifies 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
virtualMachinesAssociated | array | A list of references to all virtual machines associated to the capacity reservation group. |
zones | array | The availability zones. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
capacityReservations | array | A list of all capacity reservation resource ids that belong to capacity reservation group. |
instanceView | object | The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. |
location | string | The geo-location where the resource lives. Required. |
reservationType | string | Indicates 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) |
sharingProfile | object | Specifies 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
virtualMachinesAssociated | array | A list of references to all virtual machines associated to the capacity reservation group. |
zones | array | The availability zones. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
capacityReservations | array | A list of all capacity reservation resource ids that belong to capacity reservation group. |
instanceView | object | The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. |
location | string | The geo-location where the resource lives. Required. |
reservationType | string | Indicates 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) |
sharingProfile | object | Specifies 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. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
virtualMachinesAssociated | array | A list of references to all virtual machines associated to the capacity reservation group. |
zones | array | The availability zones. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, capacity_reservation_group_name, subscription_id | $expand | The operation that retrieves information about a capacity reservation group. |
list_by_resource_group | select | resource_group_name, subscription_id | $expand | Lists 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_subscription | select | subscription_id | $expand, resourceIdsOnly | Lists 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_update | insert | resource_group_name, capacity_reservation_group_name, subscription_id, location | 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. | |
update | update | resource_group_name, capacity_reservation_group_name, subscription_id | The operation to update a capacity reservation group. When updating a capacity reservation group, only tags and sharing profile may be modified. | |
create_or_update | replace | resource_group_name, capacity_reservation_group_name, subscription_id, location | 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. | |
delete | delete | resource_group_name, capacity_reservation_group_name, subscription_id | 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. |
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 |
|---|---|---|
capacity_reservation_group_name | string | The name of the capacity reservation group. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
$expand | string | The 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. |
resourceIdsOnly | string | The 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
- get
- list_by_resource_group
- list_by_subscription
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 }}'
;
Lists 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.
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 subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
Lists 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.
SELECT
id,
name,
capacityReservations,
instanceView,
location,
reservationType,
sharingProfile,
systemData,
tags,
type,
virtualMachinesAssociated,
zones
FROM azure.compute.capacity_reservation_groups
WHERE subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
AND resourceIdsOnly = '{{ resourceIdsOnly }}'
;
INSERT examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: capacity_reservation_groups
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the capacity_reservation_groups resource.
- name: capacity_reservation_group_name
value: "{{ capacity_reservation_group_name }}"
description: Required parameter for the capacity_reservation_groups resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the capacity_reservation_groups resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
capacity reservation group Properties.
value:
capacityReservations:
- id: "{{ id }}"
virtualMachinesAssociated:
- id: "{{ id }}"
instanceView:
capacityReservations:
- utilizationInfo:
currentCapacity: {{ currentCapacity }}
virtualMachinesAllocated:
- id: "{{ id }}"
statuses: "{{ statuses }}"
name: "{{ name }}"
sharedSubscriptionIds:
- id: "{{ id }}"
sharingProfile:
subscriptionIds:
- id: "{{ id }}"
reservationType: "{{ reservationType }}"
- name: zones
value:
- "{{ zones }}"
description: |
The availability zones.
UPDATE examples
- update
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
- create_or_update
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
- delete
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
;