Skip to main content

savings_plans

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

Overview

Namesavings_plans
TypeResource
Idazure.billing_benefits.savings_plans

Fields

The following fields are returned by SELECT queries:

The request is completed.

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
namestringThe name of the resource
propertiesobjectSavings plan properties
skuobjectThe SKU to be applied for this resource
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsavingsPlanOrderId, savingsPlanId$expandGet savings plan.
listselectsavingsPlanOrderIdList savings plans in an order.
list_allselect$filter, $orderby, refreshSummary, $skiptoken, selectedState, takeList savings plans.
updateupdatesavingsPlanOrderId, savingsPlanIdUpdate savings plan.
validate_updateexecsavingsPlanOrderId, savingsPlanIdValidate savings plan patch.

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
savingsPlanIdstringID of the savings plan
savingsPlanOrderIdstringOrder ID of the savings plan
$expandstringMay be used to expand the detail information of some properties.
$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, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState}
$orderbystringMay be used to sort order by reservation properties.
$skiptokennumberThe number of savings plans to skip from the list before returning results
refreshSummarystringTo indicate whether to refresh the roll up counts of the savings plans group by provisioning states
selectedStatestringThe selected provisioning state
takenumberTo number of savings plans to return

SELECT examples

Get savings plan.

SELECT
id,
name,
properties,
sku,
systemData,
type
FROM azure.billing_benefits.savings_plans
WHERE savingsPlanOrderId = '{{ savingsPlanOrderId }}' -- required
AND savingsPlanId = '{{ savingsPlanId }}' -- required
AND $expand = '{{ $expand }}'
;

UPDATE examples

Update savings plan.

UPDATE azure.billing_benefits.savings_plans
SET
data__properties = '{{ properties }}'
WHERE
savingsPlanOrderId = '{{ savingsPlanOrderId }}' --required
AND savingsPlanId = '{{ savingsPlanId }}' --required
RETURNING
id,
name,
properties,
sku,
systemData,
type;

Lifecycle Methods

Validate savings plan patch.

EXEC azure.billing_benefits.savings_plans.validate_update 
@savingsPlanOrderId='{{ savingsPlanOrderId }}' --required,
@savingsPlanId='{{ savingsPlanId }}' --required
@@json=
'{
"benefits": "{{ benefits }}"
}'
;