reservation
Creates, updates, deletes, gets or lists a reservation resource.
Overview
| Name | reservation |
| Type | Resource |
| Id | azure.reservations.reservation |
Fields
The following fields are returned by SELECT queries:
- get
- list
- list_all
| 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. |
appliedScopeProperties | object | Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup. |
appliedScopeType | string | The applied scope type. Known values are: "Single", "Shared", and "ManagementGroup". (Single, Shared, ManagementGroup) |
appliedScopes | array | The list of applied scopes. |
archived | boolean | Indicates if the reservation is archived. |
benefitStartTime | string (date-time) | This is the DateTime when the reservation benefit started. |
billingPlan | string | The billing plan options available for this sku. Known values are: "Upfront" and "Monthly". (Upfront, Monthly) |
billingScopeId | string | Subscription that will be charged for purchasing reservation or savings plan. |
capabilities | string | Capabilities of the reservation. |
displayName | string | Friendly name for user to easily identify the reservation. |
displayProvisioningState | string | The provisioning state of the reservation for display, e.g. Succeeded. |
effectiveDateTime | string (date-time) | DateTime of the reservation starting when this version is effective from. |
etag | integer | :vartype etag: int |
expiryDate | string (date) | This is the date when the reservation will expire. |
expiryDateTime | string (date-time) | This is the date-time when the reservation will expire. |
extendedStatusInfo | object | The message giving detailed information about the status code. |
instanceFlexibility | string | Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility. Known values are: "On" and "Off". (On, Off) |
kind | string | Resource Provider type to be reserved. Default value is "Microsoft.Compute". |
lastUpdatedDateTime | string (date-time) | DateTime of the last time the reservation was updated. |
location | string | The Azure region where the reserved resource lives. |
mergeProperties | object | Properties of reservation merge. |
provisioningState | string | Current state of the reservation. Known values are: "Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", and "Merged". (Creating, PendingResourceHold, ConfirmedResourceHold, PendingBilling, ConfirmedBilling, Created, Succeeded, Cancelled, Expired, BillingFailed, Failed, Split, Merged) |
provisioningSubState | string | The provisioning sub-state of the reservation, e.g. Succeeded. |
purchaseDate | string (date) | This is the date when the reservation was purchased. |
purchaseDateTime | string (date-time) | This is the date-time when the reservation was purchased. |
quantity | integer | Quantity of the skus that are part of the reservation. Must be greater than zero. |
renew | boolean | Setting this to true will automatically purchase a new reservation on the expiration date time. |
renewDestination | string | Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. |
renewProperties | object | The renew properties for a reservation. |
renewSource | string | Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. |
reservedResourceType | string | The type of the resource that is being reserved. Known values are: "VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", and "VirtualMachineSoftware". (VirtualMachines, SqlDatabases, SuseLinux, CosmosDb, RedHat, SqlDataWarehouse, VMwareCloudSimple, RedHatOsa, Databricks, AppService, ManagedDisk, BlockBlob, RedisCache, AzureDataExplorer, MySql, MariaDb, PostgreSql, DedicatedHost, SapHana, SqlAzureHybridBenefit, AVS, DataFactory, NetAppStorage, AzureFiles, SqlEdge, VirtualMachineSoftware) |
reviewDateTime | string (date-time) | This is the date-time when the Azure Hybrid Benefit needs to be reviewed. |
sku | object | The sku information associated to this reservation. |
skuDescription | string | Description of the sku in english. |
splitProperties | object | Properties of reservation split. |
swapProperties | object | Properties of reservation swap. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
term | string | Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". (P1Y, P3Y, P5Y) |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
userFriendlyAppliedScopeType | string | The applied scope type of the reservation for display, e.g. Shared. |
userFriendlyRenewState | string | The renew state of the reservation for display, e.g. On. |
utilization | object | Reservation utilization. |
| 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. |
appliedScopeProperties | object | Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup. |
appliedScopeType | string | The applied scope type. Known values are: "Single", "Shared", and "ManagementGroup". (Single, Shared, ManagementGroup) |
appliedScopes | array | The list of applied scopes. |
archived | boolean | Indicates if the reservation is archived. |
benefitStartTime | string (date-time) | This is the DateTime when the reservation benefit started. |
billingPlan | string | The billing plan options available for this sku. Known values are: "Upfront" and "Monthly". (Upfront, Monthly) |
billingScopeId | string | Subscription that will be charged for purchasing reservation or savings plan. |
capabilities | string | Capabilities of the reservation. |
displayName | string | Friendly name for user to easily identify the reservation. |
displayProvisioningState | string | The provisioning state of the reservation for display, e.g. Succeeded. |
effectiveDateTime | string (date-time) | DateTime of the reservation starting when this version is effective from. |
etag | integer | :vartype etag: int |
expiryDate | string (date) | This is the date when the reservation will expire. |
expiryDateTime | string (date-time) | This is the date-time when the reservation will expire. |
extendedStatusInfo | object | The message giving detailed information about the status code. |
instanceFlexibility | string | Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility. Known values are: "On" and "Off". (On, Off) |
kind | string | Resource Provider type to be reserved. Default value is "Microsoft.Compute". |
lastUpdatedDateTime | string (date-time) | DateTime of the last time the reservation was updated. |
location | string | The Azure region where the reserved resource lives. |
mergeProperties | object | Properties of reservation merge. |
provisioningState | string | Current state of the reservation. Known values are: "Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", and "Merged". (Creating, PendingResourceHold, ConfirmedResourceHold, PendingBilling, ConfirmedBilling, Created, Succeeded, Cancelled, Expired, BillingFailed, Failed, Split, Merged) |
provisioningSubState | string | The provisioning sub-state of the reservation, e.g. Succeeded. |
purchaseDate | string (date) | This is the date when the reservation was purchased. |
purchaseDateTime | string (date-time) | This is the date-time when the reservation was purchased. |
quantity | integer | Quantity of the skus that are part of the reservation. Must be greater than zero. |
renew | boolean | Setting this to true will automatically purchase a new reservation on the expiration date time. |
renewDestination | string | Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. |
renewProperties | object | The renew properties for a reservation. |
renewSource | string | Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. |
reservedResourceType | string | The type of the resource that is being reserved. Known values are: "VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", and "VirtualMachineSoftware". (VirtualMachines, SqlDatabases, SuseLinux, CosmosDb, RedHat, SqlDataWarehouse, VMwareCloudSimple, RedHatOsa, Databricks, AppService, ManagedDisk, BlockBlob, RedisCache, AzureDataExplorer, MySql, MariaDb, PostgreSql, DedicatedHost, SapHana, SqlAzureHybridBenefit, AVS, DataFactory, NetAppStorage, AzureFiles, SqlEdge, VirtualMachineSoftware) |
reviewDateTime | string (date-time) | This is the date-time when the Azure Hybrid Benefit needs to be reviewed. |
sku | object | The sku information associated to this reservation. |
skuDescription | string | Description of the sku in english. |
splitProperties | object | Properties of reservation split. |
swapProperties | object | Properties of reservation swap. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
term | string | Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". (P1Y, P3Y, P5Y) |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
userFriendlyAppliedScopeType | string | The applied scope type of the reservation for display, e.g. Shared. |
userFriendlyRenewState | string | The renew state of the reservation for display, e.g. On. |
utilization | object | Reservation utilization. |
| 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. |
appliedScopeProperties | object | Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup. |
appliedScopeType | string | The applied scope type. Known values are: "Single", "Shared", and "ManagementGroup". (Single, Shared, ManagementGroup) |
appliedScopes | array | The list of applied scopes. |
archived | boolean | Indicates if the reservation is archived. |
benefitStartTime | string (date-time) | This is the DateTime when the reservation benefit started. |
billingPlan | string | The billing plan options available for this sku. Known values are: "Upfront" and "Monthly". (Upfront, Monthly) |
billingScopeId | string | Subscription that will be charged for purchasing reservation or savings plan. |
capabilities | string | Capabilities of the reservation. |
displayName | string | Friendly name for user to easily identify the reservation. |
displayProvisioningState | string | The provisioning state of the reservation for display, e.g. Succeeded. |
effectiveDateTime | string (date-time) | DateTime of the reservation starting when this version is effective from. |
etag | integer | :vartype etag: int |
expiryDate | string (date) | This is the date when the reservation will expire. |
expiryDateTime | string (date-time) | This is the date-time when the reservation will expire. |
extendedStatusInfo | object | The message giving detailed information about the status code. |
instanceFlexibility | string | Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility. Known values are: "On" and "Off". (On, Off) |
kind | string | Resource Provider type to be reserved. Default value is "Microsoft.Compute". |
lastUpdatedDateTime | string (date-time) | DateTime of the last time the reservation was updated. |
location | string | The Azure region where the reserved resource lives. |
mergeProperties | object | Properties of reservation merge. |
provisioningState | string | Current state of the reservation. Known values are: "Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", and "Merged". (Creating, PendingResourceHold, ConfirmedResourceHold, PendingBilling, ConfirmedBilling, Created, Succeeded, Cancelled, Expired, BillingFailed, Failed, Split, Merged) |
provisioningSubState | string | The provisioning sub-state of the reservation, e.g. Succeeded. |
purchaseDate | string (date) | This is the date when the reservation was purchased. |
purchaseDateTime | string (date-time) | This is the date-time when the reservation was purchased. |
quantity | integer | Quantity of the skus that are part of the reservation. Must be greater than zero. |
renew | boolean | Setting this to true will automatically purchase a new reservation on the expiration date time. |
renewDestination | string | Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. |
renewProperties | object | The renew properties for a reservation. |
renewSource | string | Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. |
reservedResourceType | string | The type of the resource that is being reserved. Known values are: "VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", and "VirtualMachineSoftware". (VirtualMachines, SqlDatabases, SuseLinux, CosmosDb, RedHat, SqlDataWarehouse, VMwareCloudSimple, RedHatOsa, Databricks, AppService, ManagedDisk, BlockBlob, RedisCache, AzureDataExplorer, MySql, MariaDb, PostgreSql, DedicatedHost, SapHana, SqlAzureHybridBenefit, AVS, DataFactory, NetAppStorage, AzureFiles, SqlEdge, VirtualMachineSoftware) |
reviewDateTime | string (date-time) | This is the date-time when the Azure Hybrid Benefit needs to be reviewed. |
sku | object | The sku information associated to this reservation. |
skuDescription | string | Description of the sku in english. |
splitProperties | object | Properties of reservation split. |
swapProperties | object | Properties of reservation swap. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
term | string | Represent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". (P1Y, P3Y, P5Y) |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
userFriendlyAppliedScopeType | string | The applied scope type of the reservation for display, e.g. Shared. |
userFriendlyRenewState | string | The renew state of the reservation for display, e.g. On. |
utilization | object | Reservation utilization. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | reservation_order_id, reservation_id | $expand | Get Reservation details. Get specific Reservation details. |
list | select | reservation_order_id | Get Reservations in a given reservation Order. List Reservations within a single ReservationOrder. | |
list_all | select | $filter, $orderby, refreshSummary, $skiptoken, selectedState, take | List the reservations and the roll up counts of reservations group by provisioning states that the user has access to in the current tenant. | |
update | update | reservation_order_id, reservation_id | Updates a Reservation. Updates the applied scopes of the Reservation. | |
list_revisions | exec | reservation_order_id, reservation_id | Get Reservation revisions. List of all the revisions for the Reservation. | |
available_scopes | exec | reservation_order_id, reservation_id | Get Available Scopes for Reservation. Check whether the scopes from request is valid for Reservation. | |
archive | exec | reservation_order_id, reservation_id | Archive a Reservation. Archiving a Reservation moves it to Archived state. | |
unarchive | exec | reservation_order_id, reservation_id | Unarchive a Reservation. Restores a Reservation to the state it was before archiving. | |
split | exec | reservation_order_id | Split the Reservation. Split a Reservation into two Reservations with specified quantity distribution. | |
merge | exec | reservation_order_id | Merges two Reservations. Merge the specified Reservations into a new Reservation. The two Reservations being merged must have same properties. |
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 |
|---|---|---|
reservation_id | string | Id of the reservation item. Required. |
reservation_order_id | string | Order Id of the reservation. Required. |
$expand | string | Supported value of this query is renewProperties. Default value is None. |
$filter | string | May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState}. Default value is None. |
$orderby | string | May be used to sort order by reservation properties. Default value is None. |
$skiptoken | number | The number of reservations to skip from the list before returning results. Default value is None. |
refreshSummary | string | To indicate whether to refresh the roll up counts of the reservations group by provisioning states. Default value is None. |
selectedState | string | The selected provisioning state. Default value is None. |
take | number | To number of reservations to return. Default value is None. |
SELECT examples
- get
- list
- list_all
Get Reservation details. Get specific Reservation details.
SELECT
id,
name,
appliedScopeProperties,
appliedScopeType,
appliedScopes,
archived,
benefitStartTime,
billingPlan,
billingScopeId,
capabilities,
displayName,
displayProvisioningState,
effectiveDateTime,
etag,
expiryDate,
expiryDateTime,
extendedStatusInfo,
instanceFlexibility,
kind,
lastUpdatedDateTime,
location,
mergeProperties,
provisioningState,
provisioningSubState,
purchaseDate,
purchaseDateTime,
quantity,
renew,
renewDestination,
renewProperties,
renewSource,
reservedResourceType,
reviewDateTime,
sku,
skuDescription,
splitProperties,
swapProperties,
systemData,
term,
type,
userFriendlyAppliedScopeType,
userFriendlyRenewState,
utilization
FROM azure.reservations.reservation
WHERE reservation_order_id = '{{ reservation_order_id }}' -- required
AND reservation_id = '{{ reservation_id }}' -- required
AND $expand = '{{ $expand }}'
;
Get Reservations in a given reservation Order. List Reservations within a single ReservationOrder.
SELECT
id,
name,
appliedScopeProperties,
appliedScopeType,
appliedScopes,
archived,
benefitStartTime,
billingPlan,
billingScopeId,
capabilities,
displayName,
displayProvisioningState,
effectiveDateTime,
etag,
expiryDate,
expiryDateTime,
extendedStatusInfo,
instanceFlexibility,
kind,
lastUpdatedDateTime,
location,
mergeProperties,
provisioningState,
provisioningSubState,
purchaseDate,
purchaseDateTime,
quantity,
renew,
renewDestination,
renewProperties,
renewSource,
reservedResourceType,
reviewDateTime,
sku,
skuDescription,
splitProperties,
swapProperties,
systemData,
term,
type,
userFriendlyAppliedScopeType,
userFriendlyRenewState,
utilization
FROM azure.reservations.reservation
WHERE reservation_order_id = '{{ reservation_order_id }}' -- required
;
List the reservations and the roll up counts of reservations group by provisioning states that the user has access to in the current tenant.
SELECT
id,
name,
appliedScopeProperties,
appliedScopeType,
appliedScopes,
archived,
benefitStartTime,
billingPlan,
billingScopeId,
capabilities,
displayName,
displayProvisioningState,
effectiveDateTime,
etag,
expiryDate,
expiryDateTime,
extendedStatusInfo,
instanceFlexibility,
kind,
lastUpdatedDateTime,
location,
mergeProperties,
provisioningState,
provisioningSubState,
purchaseDate,
purchaseDateTime,
quantity,
renew,
renewDestination,
renewProperties,
renewSource,
reservedResourceType,
reviewDateTime,
sku,
skuDescription,
splitProperties,
swapProperties,
systemData,
term,
type,
userFriendlyAppliedScopeType,
userFriendlyRenewState,
utilization
FROM azure.reservations.reservation
WHERE $filter = '{{ $filter }}'
AND $orderby = '{{ $orderby }}'
AND refreshSummary = '{{ refreshSummary }}'
AND $skiptoken = '{{ $skiptoken }}'
AND selectedState = '{{ selectedState }}'
AND take = '{{ take }}'
;
UPDATE examples
- update
Updates a Reservation. Updates the applied scopes of the Reservation.
UPDATE azure.reservations.reservation
SET
properties = '{{ properties }}'
WHERE
reservation_order_id = '{{ reservation_order_id }}' --required
AND reservation_id = '{{ reservation_id }}' --required
RETURNING
id,
name,
etag,
kind,
location,
properties,
sku,
systemData,
type;
Lifecycle Methods
- list_revisions
- available_scopes
- archive
- unarchive
- split
- merge
Get Reservation revisions. List of all the revisions for the Reservation.
EXEC azure.reservations.reservation.list_revisions
@reservation_order_id='{{ reservation_order_id }}' --required,
@reservation_id='{{ reservation_id }}' --required
;
Get Available Scopes for Reservation. Check whether the scopes from request is valid for Reservation.
EXEC azure.reservations.reservation.available_scopes
@reservation_order_id='{{ reservation_order_id }}' --required,
@reservation_id='{{ reservation_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Archive a Reservation. Archiving a Reservation moves it to Archived state.
EXEC azure.reservations.reservation.archive
@reservation_order_id='{{ reservation_order_id }}' --required,
@reservation_id='{{ reservation_id }}' --required
;
Unarchive a Reservation. Restores a Reservation to the state it was before archiving.
EXEC azure.reservations.reservation.unarchive
@reservation_order_id='{{ reservation_order_id }}' --required,
@reservation_id='{{ reservation_id }}' --required
;
Split the Reservation. Split a Reservation into two Reservations with specified quantity distribution.
EXEC azure.reservations.reservation.split
@reservation_order_id='{{ reservation_order_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;
Merges two Reservations. Merge the specified Reservations into a new Reservation. The two Reservations being merged must have same properties.
EXEC azure.reservations.reservation.merge
@reservation_order_id='{{ reservation_order_id }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;