Skip to main content

reservation

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

Overview

Namereservation
TypeResource
Idazure.reservations.reservation

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
appliedScopePropertiesobjectProperties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup.
appliedScopeTypestringThe applied scope type. Known values are: "Single", "Shared", and "ManagementGroup". (Single, Shared, ManagementGroup)
appliedScopesarrayThe list of applied scopes.
archivedbooleanIndicates if the reservation is archived.
benefitStartTimestring (date-time)This is the DateTime when the reservation benefit started.
billingPlanstringThe billing plan options available for this sku. Known values are: "Upfront" and "Monthly". (Upfront, Monthly)
billingScopeIdstringSubscription that will be charged for purchasing reservation or savings plan.
capabilitiesstringCapabilities of the reservation.
displayNamestringFriendly name for user to easily identify the reservation.
displayProvisioningStatestringThe provisioning state of the reservation for display, e.g. Succeeded.
effectiveDateTimestring (date-time)DateTime of the reservation starting when this version is effective from.
etaginteger:vartype etag: int
expiryDatestring (date)This is the date when the reservation will expire.
expiryDateTimestring (date-time)This is the date-time when the reservation will expire.
extendedStatusInfoobjectThe message giving detailed information about the status code.
instanceFlexibilitystringAllows 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)
kindstringResource Provider type to be reserved. Default value is "Microsoft.Compute".
lastUpdatedDateTimestring (date-time)DateTime of the last time the reservation was updated.
locationstringThe Azure region where the reserved resource lives.
mergePropertiesobjectProperties of reservation merge.
provisioningStatestringCurrent 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)
provisioningSubStatestringThe provisioning sub-state of the reservation, e.g. Succeeded.
purchaseDatestring (date)This is the date when the reservation was purchased.
purchaseDateTimestring (date-time)This is the date-time when the reservation was purchased.
quantityintegerQuantity of the skus that are part of the reservation. Must be greater than zero.
renewbooleanSetting this to true will automatically purchase a new reservation on the expiration date time.
renewDestinationstringReservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
renewPropertiesobjectThe renew properties for a reservation.
renewSourcestringReservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.
reservedResourceTypestringThe 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)
reviewDateTimestring (date-time)This is the date-time when the Azure Hybrid Benefit needs to be reviewed.
skuobjectThe sku information associated to this reservation.
skuDescriptionstringDescription of the sku in english.
splitPropertiesobjectProperties of reservation split.
swapPropertiesobjectProperties of reservation swap.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
termstringRepresent the term of reservation. Known values are: "P1Y", "P3Y", and "P5Y". (P1Y, P3Y, P5Y)
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
userFriendlyAppliedScopeTypestringThe applied scope type of the reservation for display, e.g. Shared.
userFriendlyRenewStatestringThe renew state of the reservation for display, e.g. On.
utilizationobjectReservation utilization.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectreservation_order_id, reservation_id$expandGet Reservation details. Get specific Reservation details.
listselectreservation_order_idGet Reservations in a given reservation Order. List Reservations within a single ReservationOrder.
list_allselect$filter, $orderby, refreshSummary, $skiptoken, selectedState, takeList the reservations and the roll up counts of reservations group by provisioning states that the user has access to in the current tenant.
updateupdatereservation_order_id, reservation_idUpdates a Reservation. Updates the applied scopes of the Reservation.
list_revisionsexecreservation_order_id, reservation_idGet Reservation revisions. List of all the revisions for the Reservation.
available_scopesexecreservation_order_id, reservation_idGet Available Scopes for Reservation. Check whether the scopes from request is valid for Reservation.
archiveexecreservation_order_id, reservation_idArchive a Reservation. Archiving a Reservation moves it to Archived state.
unarchiveexecreservation_order_id, reservation_idUnarchive a Reservation. Restores a Reservation to the state it was before archiving.
splitexecreservation_order_idSplit the Reservation. Split a Reservation into two Reservations with specified quantity distribution.
mergeexecreservation_order_idMerges 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.

NameDatatypeDescription
reservation_idstringId of the reservation item. Required.
reservation_order_idstringOrder Id of the reservation. Required.
$expandstringSupported value of this query is renewProperties. Default value is None.
$filterstringMay 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.
$orderbystringMay be used to sort order by reservation properties. Default value is None.
$skiptokennumberThe number of reservations to skip from the list before returning results. Default value is None.
refreshSummarystringTo indicate whether to refresh the roll up counts of the reservations group by provisioning states. Default value is None.
selectedStatestringThe selected provisioning state. Default value is None.
takenumberTo number of reservations to return. Default value is None.

SELECT examples

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 }}'
;

UPDATE examples

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

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
;