From f2e512038483b416e8f1699c0b04275276e1194b Mon Sep 17 00:00:00 2001 From: pednekarpraj <72415888+pednekarpraj@users.noreply.github.com> Date: Wed, 19 Oct 2022 18:33:39 -0700 Subject: [PATCH] SavingsPlan GA changes (#20776) * SavingsPlan GA changes Fix validation errors Rebase with shared branch Correct version in the common-types file Review comments Review comments Refer grain enum in parameter Correct enum type Review comments More improvements * Fix duplicated model lint diff error * Use common types v2 * Move to v2 types.json * Corrected examples --- .../stable/2022-10-01/common-types.json | 6 +- .../2022-10-01/costmanagement.benefits.json | 1000 +++++++++++++++++ ...tmanagement.generatecostdetailsreport.json | 4 +- ...enefitRecommendationsByBillingAccount.json | 122 ++ ...efitRecommendationsByRecommendationId.json | 92 ++ .../SavingsPlan-BillingAccount.json | 48 + .../SavingsPlan-BillingProfile.json | 33 + .../SavingsPlan-SavingsPlanId-Monthly.json | 49 + .../SavingsPlan-SavingsPlanOrderId-Daily.json | 32 + .../stable/2022-10-01/scheduledActions.json | 88 +- .../resource-manager/readme.md | 1 + 11 files changed, 1415 insertions(+), 60 deletions(-) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.benefits.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByBillingAccount.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByRecommendationId.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json index 1d91c978140f..cf762927d012 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "2021-10-01", + "version": "2022-10-01", "title": "CostManagementClient" }, "host": "management.azure.com", @@ -47,7 +47,7 @@ }, "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -109,7 +109,7 @@ }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/Operation" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/Operation" } ] }, diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.benefits.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.benefits.json new file mode 100644 index 000000000000..3983ff67e658 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.benefits.json @@ -0,0 +1,1000 @@ +{ + "swagger": "2.0", + "info": { + "title": "CostManagementClient", + "description": "CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions.", + "version": "2022-10-01" + }, + "tags": [ + { + "name": "Benefits API", + "description": "APIs for getting benefit recommendations and benefit utilization summaries." + } + ], + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations": { + "get": { + "tags": [ + "BenefitRecommendations" + ], + "description": "List of recommendations for purchasing benefit (reservation or savings plan).", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" + }, + "x-ms-examples": { + "BenefitRecommendationsBillingAccountList": { + "$ref": "./examples/BenefitRecommendationsByBillingAccount.json" + } + }, + "operationId": "BenefitRecommendations_List", + "parameters": [ + { + "$ref": "#/parameters/benefitRecommendationsFilterParameter" + }, + { + "name": "$orderby", + "in": "query", + "description": "May be used to order the recommendations by: properties/armSkuName. This implicitly filters the results by the corresponding benefit type.", + "type": "string", + "x-ms-parameter-location": "method" + }, + { + "name": "$expand", + "in": "query", + "description": "May be used to expand the properties by: properties/usage, properties/allRecommendationDetails", + "type": "string", + "x-ms-parameter-location": "method" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/billingScopeBenefitRecommendationParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/benefitRecommendationsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{billingScope}/providers/Microsoft.CostManagement/benefitRecommendations/{recommendationId}": { + "get": { + "tags": [ + "BenefitRecommendations" + ], + "description": "Details of a benefit plan recommendation for what-if analysis.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" + }, + "x-ms-examples": { + "BenefitRecommendationById": { + "$ref": "./examples/BenefitRecommendationsByRecommendationId.json" + } + }, + "operationId": "BenefitRecommendation_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/billingScopeBenefitRecommendationParameter" + }, + { + "name": "recommendationId", + "in": "path", + "description": "The ID of the recommendation.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/benefitRecommendationModel" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries": { + "get": { + "tags": [ + "BenefitUtilizationSummaries" + ], + "operationId": "BenefitUtilizationSummaries_ListByBillingAccountId", + "description": "Lists benefit utilization summaries for the provided billingAccount. This API provides benefit utilization summaries only for enrollment accounts.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/cost-management/" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/grainParameter" + }, + { + "name": "filter", + "in": "query", + "description": "Supports filtering by properties/benefitType, properties/benefitId, properties/benefitOrderId and properties/usageDate. properties/benefitType is defaulted to savingsPlan.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/BenefitUtilizationSummariesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "SavingsPlanUtilizationSummaries-BillingAccount": { + "$ref": "./examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries": { + "get": { + "tags": [ + "BenefitUtilizationSummaries" + ], + "operationId": "BenefitUtilizationSummaries_ListByBillingProfileId", + "description": "Lists benefit utilization summaries for billingProfile.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/cost-management/" + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/billingProfileIdParameter" + }, + { + "$ref": "#/parameters/grainParameter" + }, + { + "name": "filter", + "in": "query", + "description": "Supports filtering by properties/benefitType, properties/benefitId, properties/benefitOrderId and properties/usageDate. properties/benefitType is defaulted to savingsPlan.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/BenefitUtilizationSummariesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "SavingsPlanUtilizationSummaries-BillingProfile": { + "$ref": "./examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries": { + "get": { + "tags": [ + "BenefitUtilizationSummaries" + ], + "operationId": "BenefitUtilizationSummaries_ListBySavingsPlanOrder", + "description": "Lists the savings plan utilization summaries for daily or monthly grain.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/cost-management/" + }, + "x-ms-examples": { + "SavingsPlanUtilizationSummariesDaily": { + "$ref": "./examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "description": "Supports filtering by properties/usageDate.", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/grainParameter" + }, + { + "$ref": "#/parameters/savingsPlanOrderIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/BenefitUtilizationSummariesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.BillingBenefits/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}/providers/Microsoft.CostManagement/benefitUtilizationSummaries": { + "get": { + "tags": [ + "BenefitUtilizationSummaries" + ], + "operationId": "BenefitUtilizationSummaries_ListBySavingsPlanId", + "description": "Lists the savings plan utilization summaries for daily or monthly grain.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/cost-management/" + }, + "x-ms-examples": { + "SavingsPlanUtilizationSummariesMonthlyWithSavingsPlanId": { + "$ref": "./examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "description": "Supports filtering by properties/usageDate.", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/grainParameter" + }, + { + "$ref": "#/parameters/savingsPlanOrderIdParameter" + }, + { + "$ref": "#/parameters/savingsPlanIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/BenefitUtilizationSummariesListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "benefitRecommendationsListResult": { + "type": "object", + "properties": { + "value": { + "type": "array", + "description": "The list of benefit recommendations.", + "readOnly": true, + "items": { + "$ref": "#/definitions/benefitRecommendationModel" + } + }, + "nextLink": { + "type": "string", + "description": "The link (URL) to the next page of results.", + "readOnly": true, + "format": "uri" + } + }, + "description": "Result of listing benefit recommendations." + }, + "benefitRecommendationModel": { + "type": "object", + "description": "benefit plan recommendation details.", + "allOf": [ + { + "$ref": "#/definitions/BenefitResource" + } + ], + "properties": { + "properties": { + "type": "object", + "$ref": "#/definitions/benefitRecommendationProperties" + } + } + }, + "benefitRecommendationProperties": { + "type": "object", + "description": "The properties of the benefit plan recommendation.", + "discriminator": "scope", + "properties": { + "firstConsumptionDate": { + "type": "string", + "description": "The first usage date used for looking back for computing the recommendation.", + "readOnly": true, + "format": "date-time" + }, + "lastConsumptionDate": { + "type": "string", + "description": "The last usage date used for looking back for computing the recommendation.", + "readOnly": true, + "format": "date-time" + }, + "lookBackPeriod": { + "description": "The number of days of usage used to look back for computing the recommendation.", + "$ref": "#/definitions/LookBackPeriod" + }, + "totalHours": { + "type": "integer", + "format": "int32", + "description": "The total hours for which the cost is covered. Its equal to number of records in a property 'properties/usage/charges'.", + "readOnly": true + }, + "usage": { + "type": "object", + "description": "The additional details about the usage which are considered while computing benefit recommendations.", + "$ref": "#/definitions/recommendationUsageDetails" + }, + "armSkuName": { + "description": "ARM SKU name. For example, Standard_D1_V2 for Reservations and Compute_Savings_Plan for SavingsPlan.", + "type": "string", + "readOnly": true + }, + "term": { + "description": "Term period of the benefit. For example, P1Y or P3Y.", + "$ref": "#/definitions/Term" + }, + "commitmentGranularity": { + "description": "Grain of the proposed commitment amount. For example, hourly, monthly etc.", + "$ref": "#/definitions/Grain" + }, + "currencyCode": { + "type": "string", + "description": "An ISO 4217 currency code identifier for the costs and savings amounts.", + "readOnly": true + }, + "costWithoutBenefit": { + "type": "number", + "format": "decimal", + "description": "The current cost without benefit corresponds to 'totalHours' property in a given look-back period.", + "readOnly": true + }, + "recommendationDetails": { + "type": "object", + "description": "The details of the proposed recommendation.", + "$ref": "#/definitions/allSavingsBenefitDetails" + }, + "allRecommendationDetails": { + "type": "object", + "description": "The list of all benefit recommendations.", + "readOnly": true, + "$ref": "#/definitions/allSavingsList" + }, + "scope": { + "description": "Scope of the benefit. For example, Single or Shared.", + "$ref": "#/definitions/RecommendationScope" + } + }, + "required": [ + "scope" + ] + }, + "singleScopeBenefitRecommendationProperties": { + "type": "object", + "description": "The properties of the benefit plan recommendation when scope is 'Single'.", + "x-ms-discriminator-value": "Single", + "properties": { + "subscriptionId": { + "type": "string", + "description": "The subscription ID that this single scope recommendation is for. Applicable only if recommendation is for 'Single' scope.", + "readOnly": true + }, + "resourceGroup": { + "type": "string", + "description": "The resource group that this single scope recommendation is for. Applicable only if recommendation is for 'Single' scope and 'ResourceGroup' request scope.", + "readOnly": true + } + }, + "allOf": [ + { + "$ref": "#/definitions/benefitRecommendationProperties" + } + ] + }, + "sharedScopeBenefitRecommendationProperties": { + "type": "object", + "description": "The properties of the benefit plan recommendation when scope is 'Shared'.", + "x-ms-discriminator-value": "Shared", + "allOf": [ + { + "$ref": "#/definitions/benefitRecommendationProperties" + } + ] + }, + "recommendationUsageDetails": { + "type": "object", + "description": "The additional details about the usage which are considered while computing benefit recommendations.", + "properties": { + "usageGrain": { + "description": "The grain of the usage. For example, hourly or monthly etc.", + "$ref": "#/definitions/Grain" + }, + "charges": { + "type": "array", + "description": "current cost without benefit i.e. charges at the specified grain.", + "readOnly": true, + "items": { + "type": "number", + "format": "decimal" + } + } + } + }, + "allSavingsList": { + "type": "object", + "properties": { + "value": { + "type": "array", + "description": "The list of benefit recommendations.", + "readOnly": true, + "items": { + "$ref": "#/definitions/allSavingsBenefitDetails" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "description": "The link (URL) to the next page of results.", + "readOnly": true, + "format": "uri" + } + }, + "description": "Result of listing benefit recommendations." + }, + "allSavingsBenefitDetails": { + "description": "The properties of the benefit plan recommendation details for a saving.", + "type": "object", + "properties": { + "overageCost": { + "type": "number", + "format": "decimal", + "description": "The difference between total cost and benefit cost.", + "readOnly": true + }, + "benefitCost": { + "type": "number", + "format": "decimal", + "description": "The exact cost of the estimated usage using plan. It's equal to (commitmentAmount * totalHours)", + "readOnly": true + }, + "totalCost": { + "type": "number", + "format": "decimal", + "description": "The cost of the suggested commitment.", + "readOnly": true + }, + "savingsAmount": { + "type": "number", + "format": "decimal", + "description": "The amount saved by purchasing the recommended quantity of benefit.", + "readOnly": true + }, + "savingsPercentage": { + "type": "number", + "format": "decimal", + "description": "The savings in percentage by purchasing the recommended quantity of benefit.", + "readOnly": true + }, + "coveragePercentage": { + "description": "Expected coverage at this commitment.", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "commitmentAmount": { + "description": "The commitment amount for the benefit.", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "averageUtilizationPercentage": { + "description": "Estimated average utilization percentage at this commitment.", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "wastageCost": { + "description": "Wastage cost at this commitment.", + "type": "number", + "format": "decimal", + "readOnly": true + } + } + }, + "BenefitKind": { + "type": "string", + "description": "Kind/type of the benefit.", + "enum": [ + "IncludedQuantity", + "Reservation", + "SavingsPlan" + ], + "x-ms-enum": { + "name": "benefitKind", + "modelAsString": true, + "values": [ + { + "value": "IncludedQuantity", + "description": "Benefit is IncludedQuantity.", + "name": "IncludedQuantity" + }, + { + "value": "Reservation", + "description": "Benefit is Reservation.", + "name": "Reservation" + }, + { + "value": "SavingsPlan", + "description": "Benefit is SavingsPlan.", + "name": "SavingsPlan" + } + ] + } + }, + "RecommendationScope": { + "type": "string", + "description": "Kind of the recommendation scope.", + "enum": [ + "Single", + "Shared" + ], + "x-ms-enum": { + "name": "scope", + "modelAsString": true, + "values": [ + { + "value": "Single", + "description": "Single scope recommendation.", + "name": "Single" + }, + { + "value": "Shared", + "description": "Shared scope recommendation.", + "name": "Shared" + } + ] + } + }, + "Grain": { + "type": "string", + "description": "Grain which corresponds to value.", + "enum": [ + "Hourly", + "Daily", + "Monthly" + ], + "x-ms-enum": { + "name": "grain", + "modelAsString": true, + "values": [ + { + "value": "Hourly", + "description": "Hourly grain corresponds to value per hour.", + "name": "Hourly" + }, + { + "value": "Daily", + "description": "Hourly grain corresponds to value per day.", + "name": "Daily" + }, + { + "value": "Monthly", + "description": "Hourly grain corresponds to value per month.", + "name": "Monthly" + } + ] + } + }, + "Term": { + "type": "string", + "description": "Grain which corresponds to value.", + "enum": [ + "P1Y", + "P3Y" + ], + "x-ms-enum": { + "name": "term", + "modelAsString": true, + "values": [ + { + "value": "P1Y", + "description": "Benefit term is 1 year.", + "name": "P1Y" + }, + { + "value": "P3Y", + "description": "Benefit term is 3 years.", + "name": "P3Y" + } + ] + } + }, + "LookBackPeriod": { + "type": "string", + "description": "The number of days used to look back.", + "enum": [ + "Last7Days", + "Last30Days", + "Last60Days" + ], + "x-ms-enum": { + "name": "lookBackPeriod", + "modelAsString": true, + "values": [ + { + "value": "Last7Days", + "description": "7 days used to look back.", + "name": "Last7Days" + }, + { + "value": "Last30Days", + "description": "30 days used to look back.", + "name": "Last30Days" + }, + { + "value": "Last60Days", + "description": "60 days used to look back.", + "name": "Last60Days" + } + ] + } + }, + "BenefitResource": { + "type": "object", + "description": "The benefit resource model definition.", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/Resource" + } + ], + "properties": { + "kind": { + "description": "Reservation or SavingsPlan.", + "$ref": "#/definitions/BenefitKind" + } + }, + "x-ms-azure-resource": true + }, + "BenefitUtilizationSummariesListResult": { + "description": "Result of listing benefit utilization summaries.", + "type": "object", + "properties": { + "value": { + "description": "The list of benefit utilization summaries.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/BenefitUtilizationSummary" + } + }, + "nextLink": { + "description": "The link (URL) to the next page of results.", + "type": "string", + "readOnly": true, + "format": "uri" + } + } + }, + "BenefitUtilizationSummary": { + "description": "Benefit utilization summary resource.", + "discriminator": "kind", + "type": "object", + "required": [ + "kind" + ], + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/Resource" + } + ], + "properties": { + "kind": { + "description": "Reservation, SavingsPlan or IncludedQuantity.", + "$ref": "#/definitions/BenefitKind" + } + } + }, + "BenefitUtilizationSummaryProperties": { + "description": "The properties of a benefit utilization summary.", + "type": "object", + "properties": { + "armSkuName": { + "description": "ARM SKU name. For example, Standard_D1_V2 for reservations and ComputeSavingsPlan for savings plan.", + "type": "string", + "readOnly": true + }, + "benefitId": { + "description": "The benefit ID is the identifier of a benefit within a benefit order.", + "type": "string", + "readOnly": true + }, + "benefitOrderId": { + "description": "The benefit order ID is the identifier for a benefit purchase. Each benefit order ID represents a single purchase transaction. For example: A reservation order contains reservations. The reservation order specifies the VM size and region for the reservations.", + "type": "string", + "readOnly": true + }, + "benefitType": { + "description": "The benefit type. For example, reservation or savings plan", + "$ref": "#/definitions/BenefitKind" + }, + "usageDate": { + "description": "Date corresponding to the utilization record. If the grain of data is monthly, it will be first day of month.", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "IncludedQuantityUtilizationSummary": { + "description": "Included Quantity utilization summary resource.", + "x-ms-discriminator-value": "IncludedQuantity", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/BenefitUtilizationSummary" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/IncludedQuantityUtilizationSummaryProperties", + "title": "Benefit utilization summary for benefit kind Included Quantity." + } + } + }, + "IncludedQuantityUtilizationSummaryProperties": { + "type": "object", + "description": "Included Quantity utilization summary properties.", + "allOf": [ + { + "$ref": "#/definitions/BenefitUtilizationSummaryProperties" + } + ], + "properties": { + "utilizationPercentage": { + "description": "This is the utilized percentage for the benefit ID.", + "type": "number", + "format": "decimal", + "readOnly": true + } + } + }, + "SavingsPlanUtilizationSummary": { + "description": "Savings plan utilization summary resource.", + "x-ms-discriminator-value": "SavingsPlan", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/BenefitUtilizationSummary" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/SavingsPlanUtilizationSummaryProperties", + "title": "Benefit utilization Summary for benefit kind savings plan." + } + } + }, + "SavingsPlanUtilizationSummaryProperties": { + "type": "object", + "description": "Savings plan utilization summary properties.", + "allOf": [ + { + "$ref": "#/definitions/BenefitUtilizationSummaryProperties" + } + ], + "properties": { + "avgUtilizationPercentage": { + "description": "This is the average utilization percentage for the benefit ID.", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "minUtilizationPercentage": { + "description": "This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4, utilization was 10%, this field will return 10% for that day", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "maxUtilizationPercentage": { + "description": "This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4, utilization was 100%, this field will return 100% for that day.", + "type": "number", + "format": "decimal", + "readOnly": true + } + } + } + }, + "parameters": { + "billingScopeBenefitRecommendationParameter": { + "name": "billingScope", + "in": "path", + "description": "The scope associated with benefit recommendation details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "benefitRecommendationsFilterParameter": { + "name": "$filter", + "in": "query", + "description": "Can be used to filter benefitRecommendations by: properties/scope with allowed values ['Single', 'Shared'] and default value 'Shared'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last60Days'; properties/term with allowed values ['P1Y', 'P3Y'] and default value 'P3Y'; kind with default value 'SavingsPlan'; properties/armSkuName with allowed values ['Compute', 'SQL'] - if mentioned kind SavingsPlan is applied implicitly; properties/subscriptionId; properties/resourceGroup", + "type": "string", + "x-ms-parameter-location": "method" + }, + "billingAccountIdParameter": { + "description": "Billing account ID", + "in": "path", + "name": "billingAccountId", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "savingsPlanOrderIdParameter": { + "description": "Savings plan order ID.", + "in": "path", + "name": "savingsPlanOrderId", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "savingsPlanIdParameter": { + "description": "Savings plan ID.", + "in": "path", + "name": "savingsPlanId", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "billingProfileIdParameter": { + "description": "Azure billing profile ID.", + "in": "path", + "name": "billingProfileId", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "grainParameter": { + "description": "Daily or monthly grain.", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "type": "string", + "name": "grainParameter", + "enum": [ + "Hourly", + "Daily", + "Monthly" + ], + "x-ms-enum": { + "name": "grainParameter", + "modelAsString": true, + "values": [ + { + "value": "Hourly", + "description": "Hourly grain corresponds to value per hour.", + "name": "Hourly" + }, + { + "value": "Daily", + "description": "Hourly grain corresponds to value per day.", + "name": "Daily" + }, + { + "value": "Monthly", + "description": "Hourly grain corresponds to value per month.", + "name": "Monthly" + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json index d4f2e6f5291e..ed28036043b8 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json @@ -75,7 +75,7 @@ "$ref": "#/parameters/scopeUsageDetailsParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "parameters", @@ -145,7 +145,7 @@ "description": "The target operation Id." }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByBillingAccount.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByBillingAccount.json new file mode 100644 index 000000000000..2eaa5aec0263 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByBillingAccount.json @@ -0,0 +1,122 @@ +{ + "parameters": { + "api-version": "2021-11-15-preview", + "billingScope": "providers/Microsoft.Billing/billingAccounts/123456", + "$expand": "properties/usage,properties/allRecommendationDetails", + "$filter": "properties/lookBackPeriod eq 'Last7Days' AND properties/term eq 'P1Y' AND properties/kind eq 'SavingsPlan'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "billingAccount/123456/providers/Microsoft.CostManagement/benefitRecommendations/00000000-0000-0000-0000-000000000000", + "name": "00000000-0000-0000-0000-000000000000", + "type": "Microsoft.Consumption/benefitRecommendations", + "kind": "SavingsPlan", + "properties": { + "firstConsumptionDate": "2022-01-24T00:00:00Z", + "lastConsumptionDate": "2022-01-31T00:00:00Z", + "lookBackPeriod": "Last7Days", + "totalHours": 168, + "usage": { + "usageGrain": "Hourly", + "charges": [ + 1.0, + 1.0, + 0.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 2.0, + 2.0, + 2.0, + 2.0 + ] + }, + "armSkuName": "Compute_Savings_Plan", + "term": "P1Y", + "commitmentGranularity": "Hourly", + "currencyCode": "USD", + "costWithoutBenefit": 218.267, + "scope": "Shared", + "recommendationDetails": { + "averageUtilizationPercentage": 99.330, + "coveragePercentage": 54.609, + "commitmentAmount": 0.164, + "overageCost": 144.841, + "benefitCost": 52.002, + "savingsAmount": 21.424, + "savingsPercentage": 9.815, + "totalCost": 196.843, + "wastageCost": 0.035 + }, + "allRecommendationDetails": { + "value": [ + { + "averageUtilizationPercentage": 99.330, + "coveragePercentage": 54.609, + "commitmentAmount": 0.164, + "overageCost": 144.841, + "benefitCost": 52.002, + "savingsAmount": 21.424, + "savingsPercentage": 9.815, + "totalCost": 196.843, + "wastageCost": 0.035 + }, + { + "averageUtilizationPercentage": 81.474, + "coveragePercentage": 56.748, + "commitmentAmount": 0.161, + "overageCost": 120.389, + "benefitCost": 83.754, + "savingsAmount": 14.124, + "savingsPercentage": 6.470, + "totalCost": 204.143, + "wastageCost": 0.100 + } + ] + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByRecommendationId.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByRecommendationId.json new file mode 100644 index 000000000000..afa1170c97e1 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitRecommendationsByRecommendationId.json @@ -0,0 +1,92 @@ +{ + "parameters": { + "api-version": "2021-11-15-preview", + "billingScope": "providers/Microsoft.Billing/billingAccounts/123456", + "recommendationId": "billingAccount/123456/providers/Microsoft.CostManagement/benefitRecommendations/00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "id": "billingAccount/123456/providers/Microsoft.CostManagement/benefitRecommendations/00000000-0000-0000-0000-000000000000", + "name": "00000000-0000-0000-0000-000000000000", + "type": "Microsoft.Consumption/benefitRecommendations", + "kind": "SavingsPlan", + "properties": { + "firstConsumptionDate": "2022-01-24T00:00:00Z", + "lastConsumptionDate": "2022-01-31T00:00:00Z", + "lookBackPeriod": "Last7Days", + "totalHours": 168, + "usage": { + "usageGrain": "Hourly", + "charges": [ + 1.0, + 1.0, + 0.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 1.0, + 2.0, + 2.0, + 2.0 + ] + }, + "armSkuName": "Compute_Savings_Plan", + "term": "P1Y", + "commitmentGranularity": "Hourly", + "currencyCode": "USD", + "costWithoutBenefit": 218.267, + "scope": "Shared", + "recommendationDetails": { + "averageUtilizationPercentage": 99.330, + "coveragePercentage": 54.609, + "commitmentAmount": 0.164, + "overageCost": 144.841, + "benefitCost": 52.002, + "savingsAmount": 21.424, + "savingsPercentage": 9.815, + "totalCost": 196.843, + "wastageCost": 0.035 + }, + "allRecommendationDetails": { + "value": [ + { + "averageUtilizationPercentage": 99.330, + "coveragePercentage": 54.609, + "commitmentAmount": 0.164, + "overageCost": 144.841, + "benefitCost": 52.002, + "savingsAmount": 21.424, + "savingsPercentage": 9.815, + "totalCost": 196.843, + "wastageCost": 0.035 + }, + { + "averageUtilizationPercentage": 81.474, + "coveragePercentage": 56.748, + "commitmentAmount": 0.161, + "overageCost": 120.389, + "benefitCost": 83.754, + "savingsAmount": 14.124, + "savingsPercentage": 6.470, + "totalCost": 204.143, + "wastageCost": 0.100 + } + ] + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json new file mode 100644 index 000000000000..b1eafc674e35 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingAccount.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "billingAccountId": "12345", + "filter": "properties/usageDate ge 2021-11-15 and properties/usageDate le 2021-12-15", + "grain": "Daily" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.Billing/billingAccounts/12345/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116", + "kind": "SavingsPlan", + "name": "66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116", + "type": "Microsoft.CostManagement/benefitUtilizationSummaries", + "properties": { + "armSkuName": "Compute_Savings_Plan", + "avgUtilizationPercentage": 90, + "benefitOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6", + "benefitId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd", + "benefitType": "SavingsPlan", + "maxUtilizationPercentage": 100, + "minUtilizationPercentage": 80, + "usageDate": "2021-11-16T00:00:00Z" + } + }, + { + "id": "/providers/Microsoft.Billing/billingAccounts/12345/providers/Microsoft.CostManagement/benefitUtilizationSummaries/88cccc88-8ccc-8c88-888c-88cc8c8c88c8_444d44dd-d4d4-4dd4-444d-4dd4444ddddd_20211117", + "kind": "SavingsPlan", + "name": "88cccc88-8ccc-8c88-888c-88cc8c8c88c8_444d44dd-d4d4-4dd4-444d-4dd4444ddddd_20211117", + "type": "Microsoft.CostManagement/benefitUtilizationSummaries", + "properties": { + "armSkuName": "Compute_Savings_Plan", + "avgUtilizationPercentage": 60, + "benefitOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/88cccc88-8ccc-8c88-888c-88cc8c8c88c8", + "benefitId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/88cccc88-8ccc-8c88-888c-88cc8c8c88c8/savingsPlans/444d44dd-d4d4-4dd4-444d-4dd4444ddddd", + "benefitType": "SavingsPlan", + "maxUtilizationPercentage": 70, + "minUtilizationPercentage": 50, + "usageDate": "2021-11-17T00:00:00Z" + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json new file mode 100644 index 000000000000..5820faba65a3 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-BillingProfile.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "billingAccountId": "c0a00000-0e04-5ee3-000e-f0c6e00000ec:c0a00000-0e04-5ee3-000e-f0c6e00000ec", + "billingProfileId": "200e5e90-000e-4960-8dcd-8d00a02db000", + "filter": "properties/usageDate ge 2021-11-15 and properties/usageDate le 2021-12-15", + "grain": "Daily" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.Billing/billingAccounts/c0a00000-0e04-5ee3-000e-f0c6e00000ec:c0a00000-0e04-5ee3-000e-f0c6e00000ec/billingProfiles/200e5e90-000e-4960-8dcd-8d00a02db000/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116", + "kind": "SavingsPlan", + "name": "66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116", + "type": "Microsoft.CostManagement/benefitUtilizationSummaries", + "properties": { + "armSkuName": "Compute_Savings_Plan", + "avgUtilizationPercentage": 90, + "benefitOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6", + "benefitId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd", + "benefitType": "SavingsPlan", + "maxUtilizationPercentage": 100, + "minUtilizationPercentage": 80, + "usageDate": "2021-11-16T00:00:00Z" + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json new file mode 100644 index 000000000000..69549cfd046d --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanId-Monthly.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "savingsPlanOrderId": "66cccc66-6ccc-6c66-666c-66cc6c6c66c6", + "savingsPlanId": "222d22dd-d2d2-2dd2-222d-2dd2222ddddd", + "filter": "properties/usageDate ge 2021-11-15 and properties/usageDate le 2021-12-15", + "grain": "Monthly" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202111", + "kind": "SavingsPlan", + "name": "66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202111", + "type": "Microsoft.CostManagement/benefitUtilizationSummaries", + "properties": { + "armSkuName": "Compute_Savings_Plan", + "avgUtilizationPercentage": 90, + "benefitOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6", + "benefitId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd", + "benefitType": "SavingsPlan", + "maxUtilizationPercentage": 100, + "minUtilizationPercentage": 80, + "usageDate": "2021-11-01T00:00:00Z" + } + }, + { + "id": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202112", + "kind": "SavingsPlan", + "name": "66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_202112", + "type": "Microsoft.CostManagement/benefitUtilizationSummaries", + "properties": { + "armSkuName": "Compute_Savings_Plan", + "avgUtilizationPercentage": 80, + "benefitOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6", + "benefitId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd", + "benefitType": "SavingsPlan", + "maxUtilizationPercentage": 90, + "minUtilizationPercentage": 70, + "usageDate": "2021-12-01T00:00:00Z" + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json new file mode 100644 index 000000000000..d8e3080f37f6 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/BenefitUtilizationSummaries/SavingsPlan-SavingsPlanOrderId-Daily.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "savingsPlanOrderId": "66cccc66-6ccc-6c66-666c-66cc6c6c66c6", + "filter": "properties/usageDate ge 2021-11-15 and properties/usageDate le 2021-12-15", + "grain": "Daily" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/providers/Microsoft.CostManagement/benefitUtilizationSummaries/66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116", + "kind": "SavingsPlan", + "name": "66cccc66-6ccc-6c66-666c-66cc6c6c66c6_222d22dd-d2d2-2dd2-222d-2dd2222ddddd_20211116", + "type": "Microsoft.CostManagement/benefitUtilizationSummaries", + "properties": { + "armSkuName": "Compute_Savings_Plan", + "avgUtilizationPercentage": 90, + "benefitOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6", + "benefitId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/66cccc66-6ccc-6c66-666c-66cc6c6c66c6/savingsPlans/222d22dd-d2d2-2dd2-222d-2dd2222ddddd", + "benefitType": "SavingsPlan", + "maxUtilizationPercentage": 100, + "minUtilizationPercentage": 80, + "usageDate": "2021-11-16T00:00:00Z" + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json index fe4e27a26707..4560bfd340b8 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json @@ -53,7 +53,7 @@ }, "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "$filter", @@ -73,7 +73,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } }, @@ -105,7 +105,7 @@ "$ref": "#/parameters/scopeParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "$filter", @@ -125,7 +125,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } }, @@ -151,7 +151,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "scheduledAction", @@ -179,7 +179,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -203,7 +203,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -216,7 +216,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -240,7 +240,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -253,7 +253,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -282,7 +282,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "scheduledAction", @@ -310,7 +310,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -337,7 +337,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -350,7 +350,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -377,7 +377,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -390,7 +390,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -413,7 +413,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -423,7 +423,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -449,7 +449,7 @@ "$ref": "#/parameters/scheduledActionNameParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" } ], "responses": { @@ -459,7 +459,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -479,7 +479,7 @@ }, "parameters": [ { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "checkNameAvailabilityRequest", @@ -487,7 +487,7 @@ "in": "body", "required": true, "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityRequest" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/CheckNameAvailabilityRequest" } } ], @@ -495,13 +495,13 @@ "200": { "description": "Response of scheduled action name availability.", "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/CheckNameAvailabilityResponse" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -524,7 +524,7 @@ "$ref": "#/parameters/scopeParameter" }, { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "checkNameAvailabilityRequest", @@ -532,7 +532,7 @@ "in": "body", "required": true, "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityRequest" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/CheckNameAvailabilityRequest" } } ], @@ -540,13 +540,13 @@ "200": { "description": "Response of scheduled action name availability.", "schema": { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityResponse" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/CheckNameAvailabilityResponse" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "common-types.json#/definitions/ErrorResponse" } } } @@ -571,32 +571,6 @@ "modelAsString": true } }, - "ErrorResponse": { - "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", - "type": "object", - "properties": { - "error": { - "description": "The details of the error.", - "$ref": "#/definitions/ErrorDetails" - } - } - }, - "ErrorDetails": { - "description": "The details of the error.", - "type": "object", - "properties": { - "code": { - "description": "Error code.", - "type": "string", - "readOnly": true - }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string", - "readOnly": true - } - } - }, "FileDestination": { "type": "object", "description": "Destination of the view data. This is optional. Currently only CSV format is supported.", @@ -680,11 +654,15 @@ "kind": { "$ref": "#/definitions/ScheduledActionKind", "description": "Kind of the scheduled action." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "description": "Kind of the scheduled action." } }, "allOf": [ { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ProxyResource" } ], "type": "object", diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 91b95962bd58..6c5457b40760 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -42,6 +42,7 @@ input-file: - Microsoft.CostManagement/stable/2022-10-01/common-types.json - Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json - Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json + - Microsoft.CostManagement/stable/2022-10-01/costmanagement.benefits.json ``` ### Tag: package-preview-2022-10