Skip to main content

reservations

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

Overview

Namereservations
TypeResource
Idazure.billing.reservations

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 of the reservation.
appliedScopesarrayThe array of applied scopes of a reservation. Will be null if the reservation is in Shared scope.
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.
displayNamestringThe display name of the reservation.
displayProvisioningStatestringThe provisioning state of the reservation for display, e.g. Succeeded.
effectiveDateTimestring (date-time)The effective date time of the reservation.
etaginteger:vartype etag: int
expiryDatestringThe expiry date of the reservation.
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)
lastUpdatedDateTimestring (date-time)DateTime of the last time the reservation was updated.
locationstringThe location of the reservation.
mergePropertiesobjectProperties of reservation merge.
productCodestringRepresents UPN.
provisioningStatestringThe provisioning state of the reservation, e.g. Succeeded.
provisioningSubStatestringThe provisioning 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.
quantitynumberThe number of the reservation.
renewbooleanThe renew state of the reservation.
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.
renewSourcestringThe renew source of the reservation.
reservedResourceTypestringThe reserved source type of the reservation, e.g. virtual machine.
reviewDateTimestring (date-time)This is the date-time when the Azure Hybrid Benefit needs to be reviewed.
skuobjectThe sku information associated to this reservation.
skuDescriptionstringThe sku description of the reservation.
splitPropertiesobjectProperties of reservation split.
swapPropertiesobjectProperties of reservation swap.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectTags for this reservation.
termstringThe term of the reservation, e.g. P1Y.
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
get_by_reservation_orderselectbilling_account_name, reservation_order_id, reservation_idexpandGet Reservation details in the billing account. Get specific Reservation details in the billing account.
list_by_reservation_orderselectbilling_account_name, reservation_order_idGet Reservations in a given reservation Order in the billing account. List Reservations within a single ReservationOrder in the billing account.
list_by_billing_profileselectbilling_account_name, billing_profile_namefilter, orderBy, skiptoken, refreshSummary, selectedState, takeLists the reservations for a billing profile and the roll up counts of reservations group by provisioning state.
list_by_billing_accountselectbilling_account_namefilter, orderBy, skiptoken, refreshSummary, selectedState, takeLists the reservations in the billing account and the roll up counts of reservations group by provisioning states.
update_by_billing_accountupdatebilling_account_name, reservation_order_id, reservation_idUpdate reservation by billing account.

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
billing_account_namestringThe ID that uniquely identifies a billing account. Required.
billing_profile_namestringThe ID that uniquely identifies a billing profile. Required.
reservation_idstringId of the reservation item. Required.
reservation_order_idstringOrder Id of the reservation. Required.
expandstringMay be used to expand the detail information of some properties. Default value is None.
filterstringThe filter query option allows clients to filter a collection of resources that are addressed by a request URL. Default value is None.
orderBystringThe orderby query option allows clients to request resources in a particular order. 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.
skiptokennumberThe number of reservations to skip from the list before returning results. Default value is None.
takenumberThe number of reservations to return in API response. Default value is None.

SELECT examples

Get Reservation details in the billing account. Get specific Reservation details in the billing account.

SELECT
id,
name,
appliedScopeProperties,
appliedScopeType,
appliedScopes,
archived,
benefitStartTime,
billingPlan,
billingScopeId,
capabilities,
displayName,
displayProvisioningState,
effectiveDateTime,
etag,
expiryDate,
expiryDateTime,
extendedStatusInfo,
instanceFlexibility,
lastUpdatedDateTime,
location,
mergeProperties,
productCode,
provisioningState,
provisioningSubState,
purchaseDate,
purchaseDateTime,
quantity,
renew,
renewDestination,
renewProperties,
renewSource,
reservedResourceType,
reviewDateTime,
sku,
skuDescription,
splitProperties,
swapProperties,
systemData,
tags,
term,
type,
userFriendlyAppliedScopeType,
userFriendlyRenewState,
utilization
FROM azure.billing.reservations
WHERE billing_account_name = '{{ billing_account_name }}' -- required
AND reservation_order_id = '{{ reservation_order_id }}' -- required
AND reservation_id = '{{ reservation_id }}' -- required
AND expand = '{{ expand }}'
;

UPDATE examples

Update reservation by billing account.

UPDATE azure.billing.reservations
SET
properties = '{{ properties }}',
sku = '{{ sku }}',
tags = '{{ tags }}'
WHERE
billing_account_name = '{{ billing_account_name }}' --required
AND reservation_order_id = '{{ reservation_order_id }}' --required
AND reservation_id = '{{ reservation_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
sku,
systemData,
tags,
type;