savings_plan
Creates, updates, deletes, gets or lists a savings_plan resource.
Overview
| Name | savings_plan |
| Type | Resource |
| Id | azure.billing_benefits.savings_plan |
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. |
appliedScopeType | string | Type of the Applied Scope. Known values are: "Single", "Shared", and "ManagementGroup". (Single, Shared, ManagementGroup) |
benefitStartTime | string (date-time) | This is the DateTime when the savings plan benefit started. |
billingAccountId | string | Fully-qualified identifier of the billing account where the benefit is applied. Present only for Enterprise Agreement customers. |
billingPlan | string | Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. "P1M" (P1M) |
billingProfileId | string | Fully-qualified identifier of the billing profile where the benefit is applied. Present only for Field-led or Customer-led customers. |
billingScopeId | string | Subscription that will be charged for purchasing the benefit. |
commitment | object | Commitment towards the benefit. |
customerId | string | Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. |
displayName | string | Display name. |
displayProvisioningState | string | The provisioning state of the savings plan for display, e.g. Succeeded. |
effectiveDateTime | string (date-time) | DateTime of the savings plan starts providing benefit from. |
expiryDateTime | string (date-time) | Expiry date time. |
extendedStatusInfo | object | :vartype extended_status_info: ~azure.mgmt.billingbenefits.models.ExtendedStatusInfo |
provisioningState | string | Provisioning state. Known values are: "Creating", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", and "Failed". (Creating, PendingBilling, ConfirmedBilling, Created, Succeeded, Cancelled, Expired, Failed) |
purchaseDateTime | string (date-time) | Date time when the savings plan was purchased. |
renew | boolean | Setting this to true will automatically purchase a new benefit on the expiration date time. |
renewDestination | string | SavingsPlan Id of the SavingsPlan which is purchased because of renew. |
renewProperties | object | :vartype renew_properties: ~azure.mgmt.billingbenefits.models.RenewProperties |
renewSource | string | SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed. |
sku | object | Savings plan SKU. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
term | string | Represent benefit term in ISO 8601 format. Known values are: "P1M", "P1Y", "P3Y", and "P5Y". (P1M, 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 savings plan for display, e.g. Shared. |
utilization | object | Savings plan 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. |
appliedScopeType | string | Type of the Applied Scope. Known values are: "Single", "Shared", and "ManagementGroup". (Single, Shared, ManagementGroup) |
benefitStartTime | string (date-time) | This is the DateTime when the savings plan benefit started. |
billingAccountId | string | Fully-qualified identifier of the billing account where the benefit is applied. Present only for Enterprise Agreement customers. |
billingPlan | string | Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. "P1M" (P1M) |
billingProfileId | string | Fully-qualified identifier of the billing profile where the benefit is applied. Present only for Field-led or Customer-led customers. |
billingScopeId | string | Subscription that will be charged for purchasing the benefit. |
commitment | object | Commitment towards the benefit. |
customerId | string | Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. |
displayName | string | Display name. |
displayProvisioningState | string | The provisioning state of the savings plan for display, e.g. Succeeded. |
effectiveDateTime | string (date-time) | DateTime of the savings plan starts providing benefit from. |
expiryDateTime | string (date-time) | Expiry date time. |
extendedStatusInfo | object | :vartype extended_status_info: ~azure.mgmt.billingbenefits.models.ExtendedStatusInfo |
provisioningState | string | Provisioning state. Known values are: "Creating", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", and "Failed". (Creating, PendingBilling, ConfirmedBilling, Created, Succeeded, Cancelled, Expired, Failed) |
purchaseDateTime | string (date-time) | Date time when the savings plan was purchased. |
renew | boolean | Setting this to true will automatically purchase a new benefit on the expiration date time. |
renewDestination | string | SavingsPlan Id of the SavingsPlan which is purchased because of renew. |
renewProperties | object | :vartype renew_properties: ~azure.mgmt.billingbenefits.models.RenewProperties |
renewSource | string | SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed. |
sku | object | Savings plan SKU. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
term | string | Represent benefit term in ISO 8601 format. Known values are: "P1M", "P1Y", "P3Y", and "P5Y". (P1M, 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 savings plan for display, e.g. Shared. |
utilization | object | Savings plan 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. |
appliedScopeType | string | Type of the Applied Scope. Known values are: "Single", "Shared", and "ManagementGroup". (Single, Shared, ManagementGroup) |
benefitStartTime | string (date-time) | This is the DateTime when the savings plan benefit started. |
billingAccountId | string | Fully-qualified identifier of the billing account where the benefit is applied. Present only for Enterprise Agreement customers. |
billingPlan | string | Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. "P1M" (P1M) |
billingProfileId | string | Fully-qualified identifier of the billing profile where the benefit is applied. Present only for Field-led or Customer-led customers. |
billingScopeId | string | Subscription that will be charged for purchasing the benefit. |
commitment | object | Commitment towards the benefit. |
customerId | string | Fully-qualified identifier of the customer where the savings plan is applied. Present only for Partner-led customers. |
displayName | string | Display name. |
displayProvisioningState | string | The provisioning state of the savings plan for display, e.g. Succeeded. |
effectiveDateTime | string (date-time) | DateTime of the savings plan starts providing benefit from. |
expiryDateTime | string (date-time) | Expiry date time. |
extendedStatusInfo | object | :vartype extended_status_info: ~azure.mgmt.billingbenefits.models.ExtendedStatusInfo |
provisioningState | string | Provisioning state. Known values are: "Creating", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", and "Failed". (Creating, PendingBilling, ConfirmedBilling, Created, Succeeded, Cancelled, Expired, Failed) |
purchaseDateTime | string (date-time) | Date time when the savings plan was purchased. |
renew | boolean | Setting this to true will automatically purchase a new benefit on the expiration date time. |
renewDestination | string | SavingsPlan Id of the SavingsPlan which is purchased because of renew. |
renewProperties | object | :vartype renew_properties: ~azure.mgmt.billingbenefits.models.RenewProperties |
renewSource | string | SavingsPlan Id of the SavingsPlan from which this SavingsPlan is renewed. |
sku | object | Savings plan SKU. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
term | string | Represent benefit term in ISO 8601 format. Known values are: "P1M", "P1Y", "P3Y", and "P5Y". (P1M, 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 savings plan for display, e.g. Shared. |
utilization | object | Savings plan utilization. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | savings_plan_order_id, savings_plan_id | $expand | Get savings plan. |
list | select | savings_plan_order_id | List savings plans in an order. | |
list_all | select | $filter, $orderby, refreshSummary, $skiptoken, selectedState, take | List savings plans. | |
update | update | savings_plan_order_id, savings_plan_id | Update savings plan. | |
validate_update | exec | savings_plan_order_id, savings_plan_id | Validate 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.
| Name | Datatype | Description |
|---|---|---|
savings_plan_id | string | ID of the savings plan. Required. |
savings_plan_order_id | string | Order ID of the savings plan. Required. |
$expand | string | |
$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, 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 savings plans 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 savings plans group by provisioning states. Default value is None. |
selectedState | string | The selected provisioning state. Default value is None. |
take | number | To number of savings plans to return. Default value is None. |
SELECT examples
- get
- list
- list_all
Get savings plan.
SELECT
id,
name,
appliedScopeProperties,
appliedScopeType,
benefitStartTime,
billingAccountId,
billingPlan,
billingProfileId,
billingScopeId,
commitment,
customerId,
displayName,
displayProvisioningState,
effectiveDateTime,
expiryDateTime,
extendedStatusInfo,
provisioningState,
purchaseDateTime,
renew,
renewDestination,
renewProperties,
renewSource,
sku,
systemData,
term,
type,
userFriendlyAppliedScopeType,
utilization
FROM azure.billing_benefits.savings_plan
WHERE savings_plan_order_id = '{{ savings_plan_order_id }}' -- required
AND savings_plan_id = '{{ savings_plan_id }}' -- required
AND $expand = '{{ $expand }}'
;
List savings plans in an order.
SELECT
id,
name,
appliedScopeProperties,
appliedScopeType,
benefitStartTime,
billingAccountId,
billingPlan,
billingProfileId,
billingScopeId,
commitment,
customerId,
displayName,
displayProvisioningState,
effectiveDateTime,
expiryDateTime,
extendedStatusInfo,
provisioningState,
purchaseDateTime,
renew,
renewDestination,
renewProperties,
renewSource,
sku,
systemData,
term,
type,
userFriendlyAppliedScopeType,
utilization
FROM azure.billing_benefits.savings_plan
WHERE savings_plan_order_id = '{{ savings_plan_order_id }}' -- required
;
List savings plans.
SELECT
id,
name,
appliedScopeProperties,
appliedScopeType,
benefitStartTime,
billingAccountId,
billingPlan,
billingProfileId,
billingScopeId,
commitment,
customerId,
displayName,
displayProvisioningState,
effectiveDateTime,
expiryDateTime,
extendedStatusInfo,
provisioningState,
purchaseDateTime,
renew,
renewDestination,
renewProperties,
renewSource,
sku,
systemData,
term,
type,
userFriendlyAppliedScopeType,
utilization
FROM azure.billing_benefits.savings_plan
WHERE $filter = '{{ $filter }}'
AND $orderby = '{{ $orderby }}'
AND refreshSummary = '{{ refreshSummary }}'
AND $skiptoken = '{{ $skiptoken }}'
AND selectedState = '{{ selectedState }}'
AND take = '{{ take }}'
;
UPDATE examples
- update
Update savings plan.
UPDATE azure.billing_benefits.savings_plan
SET
properties = '{{ properties }}'
WHERE
savings_plan_order_id = '{{ savings_plan_order_id }}' --required
AND savings_plan_id = '{{ savings_plan_id }}' --required
RETURNING
id,
name,
properties,
sku,
systemData,
type;
Lifecycle Methods
- validate_update
Validate savings plan patch.
EXEC azure.billing_benefits.savings_plan.validate_update
@savings_plan_order_id='{{ savings_plan_order_id }}' --required,
@savings_plan_id='{{ savings_plan_id }}' --required
@@json=
'{
"benefits": "{{ benefits }}"
}'
;