From 5d22cc9e72dd20a70cc3f8ab150287539dec2def Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 18:46:20 -0800 Subject: [PATCH 01/23] Adding Budgets API translated from 2022-10-01 stable version of Microsoft.Consumption/budgets --- .../costmanagement.budgets.json | 595 ++++++++++++++++++ .../examples/Budgets/Budget.json | 85 +++ .../examples/Budgets/BudgetsList.json | 186 ++++++ .../Budgets/CreateOrUpdateBudget.json | 227 +++++++ .../examples/Budgets/DeleteBudget.json | 12 + 5 files changed, 1105 insertions(+) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json new file mode 100644 index 000000000000..fb4e7ecbff0b --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -0,0 +1,595 @@ +{ + "swagger": "2.0", + "info": { + "title": "CostManagementClient", + "description": "CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions.", + "version": "2023-04-01-preview" + }, + "tags": [ + { + "name": "Budgets API", + "description": "APIs for creating and managing cost and utilization alerts." + } + ], + "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": { + "/{scope}/providers/Microsoft.CostManagement/budgets": { + "get": { + "tags": [ + "Budgets" + ], + "operationId": "Budgets_List", + "description": "Lists all budgets for the defined scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" + }, + "x-ms-examples": { + "BudgetsList": { + "$ref": "./examples/Budgets/BudgetsList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeBudgetParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/BudgetsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}": { + "get": { + "tags": [ + "Budgets" + ], + "operationId": "Budgets_Get", + "description": "Gets the budget for the scope by budget name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" + }, + "x-ms-examples": { + "Budget": { + "$ref": "./examples/Budgets/Budget.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeBudgetParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/budgetNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Budget" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Budgets" + ], + "operationId": "Budgets_CreateOrUpdate", + "description": "The operation to create or update a budget. You can optionally provide an eTag if desired as a form of concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put operation.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" + }, + "x-ms-examples": { + "CreateOrUpdateBudget": { + "$ref": "./examples/Budgets/CreateOrUpdateBudget.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeBudgetParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/budgetNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Budget" + }, + "description": "Parameters supplied to the Create Budget operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Budget" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/Budget" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Budgets" + ], + "operationId": "Budgets_Delete", + "description": "The operation to delete a budget.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" + }, + "x-ms-examples": { + "DeleteBudget": { + "$ref": "./examples/Budgets/DeleteBudget.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeBudgetParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/budgetNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "common-types.json#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "BudgetsListResult": { + "description": "Result of listing budgets. It contains a list of available budgets in the scope provided.", + "properties": { + "value": { + "description": "The list of budgets.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Budget" + } + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "Budget": { + "description": "A budget resource.", + "type": "object", + "allOf": [ + { + "$ref": "common-types.json#/definitions/CostManagementProxyResource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/BudgetProperties", + "title": "Budget properties" + } + } + }, + "BudgetProperties": { + "description": "The properties of the budget.", + "properties": { + "category": { + "description": "The category of the budget, whether the budget tracks cost or usage.", + "type": "string", + "enum": [ + "Cost" + ], + "x-ms-enum": { + "name": "CategoryType", + "modelAsString": true + } + }, + "amount": { + "description": "The total amount of cost to track with the budget", + "type": "number", + "format": "decimal" + }, + "timeGrain": { + "description": "The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers", + "type": "string", + "enum": [ + "Monthly", + "Quarterly", + "Annually", + "BillingMonth", + "BillingQuarter", + "BillingAnnual" + ], + "x-ms-enum": { + "name": "TimeGrainType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has start and end date of the budget. The start date must be first of the month and should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date.", + "$ref": "#/definitions/BudgetTimePeriod" + }, + "filter": { + "description": "May be used to filter budgets by user-specified dimensions and/or tags.", + "type": "object", + "$ref": "#/definitions/BudgetFilter" + }, + "currentSpend": { + "description": "The current amount of cost which is being tracked for a budget.", + "$ref": "#/definitions/CurrentSpend", + "readOnly": true + }, + "notifications": { + "type": "object", + "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications.", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/Notification" + }, + "maxItems": 5 + }, + "forecastSpend": { + "description": "The forecasted cost which is being tracked for a budget.", + "$ref": "#/definitions/ForecastSpend", + "readOnly": true + } + }, + "required": [ + "category", + "amount", + "timeGrain", + "timePeriod" + ] + }, + "BudgetTimePeriod": { + "description": "The start and end date for a budget.", + "properties": { + "startDate": { + "description": "The start date for the budget.", + "type": "string", + "format": "date-time" + }, + "endDate": { + "description": "The end date for the budget. If not provided, we default this to 10 years from the start date.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "startDate" + ] + }, + "BudgetFilter": { + "description": "May be used to filter budgets by resource group, resource, or meter.", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/BudgetFilterProperties" + }, + "x-ms-identifiers": [], + "minItems": 0 + }, + "dimensions": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/BudgetComparisonExpression" + }, + "tags": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/BudgetComparisonExpression" + } + } + }, + "BudgetFilterProperties": { + "description": "The Dimensions or Tags to filter a budget by.", + "properties": { + "dimensions": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/BudgetComparisonExpression" + }, + "tags": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/BudgetComparisonExpression" + } + } + }, + "BudgetComparisonExpression": { + "description": "The comparison expression to be used in the budgets.", + "properties": { + "name": { + "description": "The name of the column to use in comparison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", + "type": "string", + "enum": [ + "In" + ], + "x-ms-enum": { + "name": "BudgetOperatorType", + "modelAsString": true + } + }, + "values": { + "description": "Array of values to use for comparison", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 0 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "CurrentSpend": { + "description": "The current amount of cost which is being tracked for a budget.", + "properties": { + "amount": { + "description": "The total amount of cost which is being tracked by the budget.", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "unit": { + "description": "The unit of measure for the budget amount.", + "type": "string", + "readOnly": true + } + } + }, + "ForecastSpend": { + "description": "The forecasted cost which is being tracked for a budget.", + "properties": { + "amount": { + "description": "The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type.", + "type": "number", + "format": "decimal", + "readOnly": true + }, + "unit": { + "description": "The unit of measure for the budget amount.", + "type": "string", + "readOnly": true + } + } + }, + "Notification": { + "description": "The notification associated with a budget.", + "properties": { + "enabled": { + "description": "The notification is enabled or not.", + "type": "boolean" + }, + "operator": { + "description": "The comparison operator.", + "type": "string", + "enum": [ + "EqualTo", + "GreaterThan", + "GreaterThanOrEqualTo" + ], + "x-ms-enum": { + "name": "OperatorType", + "modelAsString": true, + "values": [ + { + "value": "EqualTo", + "description": "Alert will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType will be deprecated in future. ", + "name": "EqualTo" + }, + { + "value": "GreaterThan", + "description": "Alert will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType while configuring Budget Alert.", + "name": "GreaterThan" + }, + { + "value": "GreaterThanOrEqualTo", + "description": "Alert will be triggered if the evaluated cost is greater than or equal to the threshold value.", + "name": "GreaterThanOrEqualTo" + } + ] + } + }, + "threshold": { + "description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.", + "type": "number", + "format": "decimal" + }, + "contactEmails": { + "description": "Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 0, + "maxItems": 50 + }, + "contactRoles": { + "description": "Contact roles to send the budget notification to when the threshold is exceeded.", + "type": "array", + "items": { + "type": "string" + } + }, + "contactGroups": { + "description": "Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 0, + "maxItems": 50 + }, + "thresholdType": { + "description": "The type of threshold", + "type": "string", + "enum": [ + "Actual", + "Forecasted" + ], + "x-ms-enum": { + "name": "ThresholdType", + "modelAsString": true, + "values": [ + { + "value": "Actual", + "description": "Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget .", + "name": "Actual" + }, + { + "value": "Forecasted", + "description": "Forecasted costs budget alerts provide advanced notification that your spending trends are likely to exceed your allocated budget, as it relies on forecasted cost predictions.", + "name": "Forecasted" + } + ] + }, + "default": "Actual" + }, + "locale": { + "description": "Language in which the recipient will receive the notification", + "type": "string", + "enum": [ + "en-us", + "ja-jp", + "zh-cn", + "de-de", + "es-es", + "fr-fr", + "it-it", + "ko-kr", + "pt-br", + "ru-ru", + "zh-tw", + "cs-cz", + "pl-pl", + "tr-tr", + "da-dk", + "en-gb", + "hu-hu", + "nb-no", + "nl-nl", + "pt-pt", + "sv-se" + ], + "x-ms-enum": { + "name": "CultureCode", + "modelAsString": true + } + } + }, + "required": [ + "enabled", + "operator", + "threshold", + "contactEmails" + ] + } + }, + "parameters": { + "scopeBudgetParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "budgetNameParameter": { + "name": "budgetName", + "in": "path", + "description": "Budget Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json new file mode 100644 index 000000000000..192b53acfd98 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json @@ -0,0 +1,85 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "budgetName": "TestBudget", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.Consumption/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 100.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2017-10-01T00:00:00Z", + "endDate": "2018-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "currentSpend": { + "amount": 80.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json new file mode 100644 index 000000000000..f37ee9cc9b0c --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json @@ -0,0 +1,186 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.Consumption/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 100.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2017-10-01T00:00:00Z", + "endDate": "2018-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "currentSpend": { + "amount": 80.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ] + }, + "Actual_GreaterThanOrEqualTo_90_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 90, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ] + }, + "thresholdType": "Actual" + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.Consumption/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 600.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2017-10-01T00:00:00Z", + "endDate": "2018-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "currentSpend": { + "amount": 120.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_40_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 40, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ] + }, + "Actual_GreaterThanOrEqualTo_60_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 60, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json new file mode 100644 index 000000000000..771a304770e7 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json @@ -0,0 +1,227 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "budgetName": "TestBudget", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "parameters": { + "eTag": "\"1d34d016a593709\"", + "properties": { + "category": "Cost", + "amount": 100.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2017-10-01T00:00:00Z", + "endDate": "2018-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "notifications": { + "Actual_GreaterThan_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.Consumption/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 100.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2017-10-01T00:00:00Z", + "endDate": "2018-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "currentSpend": { + "amount": 80.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + } + }, + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.Consumption/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 100.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2017-10-01T00:00:00Z", + "endDate": "2018-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "currentSpend": { + "amount": 80.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json new file mode 100644 index 000000000000..45b3e12f05a2 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "budgetName": "TestBudget", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": {} + } +} From 12962e9bb6d587dd6c93cc4b6747a070d9746923 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 18:55:13 -0800 Subject: [PATCH 02/23] Updating api-version in examples to 2023-04-01-preview --- .../preview/2023-04-01-preview/examples/Budgets/Budget.json | 2 +- .../2023-04-01-preview/examples/Budgets/BudgetsList.json | 2 +- .../examples/Budgets/CreateOrUpdateBudget.json | 2 +- .../2023-04-01-preview/examples/Budgets/DeleteBudget.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json index 192b53acfd98..42e55545c16c 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-10-01", + "api-version": "2023-04-01-preview", "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "MYDEVTESTRG", "budgetName": "TestBudget", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json index f37ee9cc9b0c..a816ca10b45d 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-10-01", + "api-version": "2023-04-01-preview", "subscriptionId": "00000000-0000-0000-0000-000000000000", "scope": "subscriptions/00000000-0000-0000-0000-000000000000", "resourceGroupName": "MYDEVTESTRG" diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json index 771a304770e7..587386ffe7d9 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-10-01", + "api-version": "2023-04-01-preview", "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "MYDEVTESTRG", "budgetName": "TestBudget", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json index 45b3e12f05a2..28c2306e3d9c 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2021-10-01", + "api-version": "2023-04-01-preview", "subscriptionId": "00000000-0000-0000-0000-000000000000", "resourceGroupName": "MYDEVTESTRG", "budgetName": "TestBudget", From f10a5f37ff3e87b3dd00ae16111a8a6ed60719c5 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 19:22:37 -0800 Subject: [PATCH 03/23] Adding costmanagement.budgets.json to readme --- specification/cost-management/resource-manager/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index a231b47adab6..93a70cd42ee8 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -41,6 +41,7 @@ These settings apply only when `--tag=package-preview-2023-04` is specified on t input-file: - Microsoft.CostManagement/preview/2023-04-01-preview/common-types.json - Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.benefits.json + - Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json - Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.exports.json - Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.generatecostdetailsreport.json - Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.generatedetailedcostreport.json From 8ef775655ba084beb4d9abfdd0eb72c44a5d5679 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 20:04:32 -0800 Subject: [PATCH 04/23] Addressing Swagger LintDiff errors --- .../costmanagement.budgets.json | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index fb4e7ecbff0b..8b62c4fc26c9 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -220,6 +220,7 @@ "definitions": { "BudgetsListResult": { "description": "Result of listing budgets. It contains a list of available budgets in the scope provided.", + "type": "object", "properties": { "value": { "description": "The list of budgets.", @@ -254,6 +255,7 @@ }, "BudgetProperties": { "description": "The properties of the budget.", + "type": "object", "properties": { "category": { "description": "The category of the budget, whether the budget tracks cost or usage.", @@ -268,8 +270,7 @@ }, "amount": { "description": "The total amount of cost to track with the budget", - "type": "number", - "format": "decimal" + "type": "number" }, "timeGrain": { "description": "The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers", @@ -325,6 +326,7 @@ }, "BudgetTimePeriod": { "description": "The start and end date for a budget.", + "type": "object", "properties": { "startDate": { "description": "The start date for the budget.", @@ -343,6 +345,7 @@ }, "BudgetFilter": { "description": "May be used to filter budgets by resource group, resource, or meter.", + "type": "object", "properties": { "and": { "description": "The logical \"AND\" expression. Must have at least 2 items.", @@ -365,6 +368,7 @@ }, "BudgetFilterProperties": { "description": "The Dimensions or Tags to filter a budget by.", + "type": "object", "properties": { "dimensions": { "description": "Has comparison expression for a dimension", @@ -378,6 +382,7 @@ }, "BudgetComparisonExpression": { "description": "The comparison expression to be used in the budgets.", + "type": "object", "properties": { "name": { "description": "The name of the column to use in comparison.", @@ -411,11 +416,11 @@ }, "CurrentSpend": { "description": "The current amount of cost which is being tracked for a budget.", + "type": "object", "properties": { "amount": { "description": "The total amount of cost which is being tracked by the budget.", "type": "number", - "format": "decimal", "readOnly": true }, "unit": { @@ -427,11 +432,11 @@ }, "ForecastSpend": { "description": "The forecasted cost which is being tracked for a budget.", + "type": "object", "properties": { "amount": { "description": "The forecasted cost for the total time period which is being tracked by the budget. This value is only provided if the budget contains a forecast alert type.", "type": "number", - "format": "decimal", "readOnly": true }, "unit": { @@ -443,6 +448,7 @@ }, "Notification": { "description": "The notification associated with a budget.", + "type": "object", "properties": { "enabled": { "description": "The notification is enabled or not.", @@ -480,8 +486,7 @@ }, "threshold": { "description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.", - "type": "number", - "format": "decimal" + "type": "number" }, "contactEmails": { "description": "Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.", From d80cf7cbc2113ba3cdcab26d702e9ae8c9bd5a20 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 20:43:31 -0800 Subject: [PATCH 05/23] Updating budget name pattern --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 8b62c4fc26c9..148369cc8358 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -594,7 +594,10 @@ "description": "Budget Name.", "required": true, "type": "string", - "x-ms-parameter-location": "method" + "x-ms-parameter-location": "method", + "pattern": "*", + "minLength": 3, + "maxLength": 50 } } } From d5f629cf81968bb5b545ae69443d576158a211bf Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 20:52:38 -0800 Subject: [PATCH 06/23] Adding suppression for R4011 --- specification/cost-management/resource-manager/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 93a70cd42ee8..6e0a93ea6f6d 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -269,6 +269,9 @@ input-file: ``` yaml directive: + - suppress: R4011 + from: costmanagement.budgets.json + reason: 'API change needed, The delete operation is defined without a 200 or 204 error response implementation,please add it' - suppress: R4011 from: costmanagement.exports.json reason: 'API change needed, The delete operation is defined without a 200 or 204 error response implementation,please add it' From 6b60347257a233c44ac65f4a88187c1551c50414 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 20:53:11 -0800 Subject: [PATCH 07/23] Adding budget name pattern regex for only alphanumeric, underscore, or hyphen characters --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 148369cc8358..c26f862a70d1 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -595,7 +595,7 @@ "required": true, "type": "string", "x-ms-parameter-location": "method", - "pattern": "*", + "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 3, "maxLength": 50 } From 8e30e5ac9aca4d0f3acbcec02a80627c4d013542 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 21:45:59 -0800 Subject: [PATCH 08/23] fixing readme.go.md for budgets --- specification/cost-management/resource-manager/readme.go.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/specification/cost-management/resource-manager/readme.go.md b/specification/cost-management/resource-manager/readme.go.md index 9080ee0734fd..d750fdc293c0 100644 --- a/specification/cost-management/resource-manager/readme.go.md +++ b/specification/cost-management/resource-manager/readme.go.md @@ -36,6 +36,11 @@ directive: - $.definitions.ExportRun.allOf[0] transform: > $['$ref'] = "common-types.json#/definitions/ProxyResourceForCostManagement"; +- from: costmanagement.budgets.json + where: + - $.definitions.Budget.allOf[0] + transform: > + $['$ref'] = "common-types.json#/definitions/ProxyResourceForCostManagement"; - rename-model: from: 'CostManagementResource' to: 'ResourceForCostManagement' From 0934476094468889bec7a16759906420693e96ce Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 22:06:45 -0800 Subject: [PATCH 09/23] removing "object" type from notifications dictionary keys --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index c26f862a70d1..6bd423fbfdbc 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -303,7 +303,6 @@ "readOnly": true }, "notifications": { - "type": "object", "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications.", "additionalProperties": { "type": "object", From cb6526fd5297bbeec69e62eb676c0563ffae2084 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 22:11:27 -0800 Subject: [PATCH 10/23] removing tags --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 6bd423fbfdbc..228bf9631db5 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -5,12 +5,6 @@ "description": "CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions.", "version": "2023-04-01-preview" }, - "tags": [ - { - "name": "Budgets API", - "description": "APIs for creating and managing cost and utilization alerts." - } - ], "host": "management.azure.com", "schemes": [ "https" From cba0132bac27f831c90ef8cfca836c8853680000 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 23:01:20 -0800 Subject: [PATCH 11/23] removing mismatching enum values --- .../costmanagement.budgets.json | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 228bf9631db5..545da06a69a1 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -457,24 +457,7 @@ ], "x-ms-enum": { "name": "OperatorType", - "modelAsString": true, - "values": [ - { - "value": "EqualTo", - "description": "Alert will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType will be deprecated in future. ", - "name": "EqualTo" - }, - { - "value": "GreaterThan", - "description": "Alert will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType while configuring Budget Alert.", - "name": "GreaterThan" - }, - { - "value": "GreaterThanOrEqualTo", - "description": "Alert will be triggered if the evaluated cost is greater than or equal to the threshold value.", - "name": "GreaterThanOrEqualTo" - } - ] + "modelAsString": true } }, "threshold": { From eeb504b9016fb2214811e279da4ee318c37f6652 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 23:02:20 -0800 Subject: [PATCH 12/23] updating notifications key type --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 545da06a69a1..73aa0af1a22a 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -297,6 +297,7 @@ "readOnly": true }, "notifications": { + "type": "string", "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications.", "additionalProperties": { "type": "object", From a0e09e97a98587ad8f31b1edf0aa7a19a44264c8 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 23:25:16 -0800 Subject: [PATCH 13/23] Revert "updating notifications key type" This reverts commit eeb504b9016fb2214811e279da4ee318c37f6652. --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 73aa0af1a22a..545da06a69a1 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -297,7 +297,6 @@ "readOnly": true }, "notifications": { - "type": "string", "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications.", "additionalProperties": { "type": "object", From 213592396e65a67140dd5b64e6d005981fea54fe Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 23:25:32 -0800 Subject: [PATCH 14/23] Revert "removing mismatching enum values" This reverts commit cba0132bac27f831c90ef8cfca836c8853680000. --- .../costmanagement.budgets.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 545da06a69a1..228bf9631db5 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -457,7 +457,24 @@ ], "x-ms-enum": { "name": "OperatorType", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "value": "EqualTo", + "description": "Alert will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType will be deprecated in future. ", + "name": "EqualTo" + }, + { + "value": "GreaterThan", + "description": "Alert will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType while configuring Budget Alert.", + "name": "GreaterThan" + }, + { + "value": "GreaterThanOrEqualTo", + "description": "Alert will be triggered if the evaluated cost is greater than or equal to the threshold value.", + "name": "GreaterThanOrEqualTo" + } + ] } }, "threshold": { From 17c6782e55ccd40f94ab114d93b97e28d3e48693 Mon Sep 17 00:00:00 2001 From: alprosms Date: Wed, 1 Mar 2023 23:29:51 -0800 Subject: [PATCH 15/23] updates to enum name --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 228bf9631db5..ee9eff842871 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -299,7 +299,6 @@ "notifications": { "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications.", "additionalProperties": { - "type": "object", "$ref": "#/definitions/Notification" }, "maxItems": 5 @@ -456,7 +455,7 @@ "GreaterThanOrEqualTo" ], "x-ms-enum": { - "name": "OperatorType", + "name": "BudgetNotificationOperatorType", "modelAsString": true, "values": [ { From 3caa4d628fbcfdd2e7d3ac908197988a7efc7b7a Mon Sep 17 00:00:00 2001 From: Alex Prosak Date: Thu, 2 Mar 2023 10:38:47 -0800 Subject: [PATCH 16/23] Removing incorrect/outdated description info --- .../2023-04-01-preview/costmanagement.budgets.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index ee9eff842871..4651079e9c85 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -70,9 +70,6 @@ "$ref": "common-types.json#/definitions/ErrorResponse" } } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" } } }, @@ -223,11 +220,6 @@ "items": { "$ref": "#/definitions/Budget" } - }, - "nextLink": { - "description": "The link (url) to the next page of results.", - "type": "string", - "readOnly": true } } }, @@ -252,7 +244,7 @@ "type": "object", "properties": { "category": { - "description": "The category of the budget, whether the budget tracks cost or usage.", + "description": "The category of the budget.", "type": "string", "enum": [ "Cost" From b4e759ae4b4a024634e77bdb7c68a7c07dd82975 Mon Sep 17 00:00:00 2001 From: Alex Prosak Date: Thu, 2 Mar 2023 10:53:47 -0800 Subject: [PATCH 17/23] fixing BudgetsList example --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 1 + .../2023-04-01-preview/examples/Budgets/BudgetsList.json | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 4651079e9c85..06bf3b6ae2c2 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -289,6 +289,7 @@ "readOnly": true }, "notifications": { + "type": "object", "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications.", "additionalProperties": { "$ref": "#/definitions/Notification" diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json index a816ca10b45d..61725c35b0fe 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json @@ -88,9 +88,9 @@ ], "contactGroups": [ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" - ] - }, - "thresholdType": "Actual" + ], + "thresholdType": "Actual" + } } } }, From 35a3fc375bfc4df22eccf47d657a24b288817b77 Mon Sep 17 00:00:00 2001 From: Alex Prosak Date: Thu, 2 Mar 2023 12:55:11 -0800 Subject: [PATCH 18/23] Updating example Ids to use Microsoft.CostManagement RP --- .../2023-04-01-preview/examples/Budgets/Budget.json | 4 ++-- .../2023-04-01-preview/examples/Budgets/BudgetsList.json | 8 ++++---- .../examples/Budgets/CreateOrUpdateBudget.json | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json index 42e55545c16c..260c1e15af05 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json @@ -9,9 +9,9 @@ "responses": { "200": { "body": { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/TestBudget", + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget", "name": "TestBudget", - "type": "Microsoft.Consumption/budgets", + "type": "Microsoft.CostManagement/budgets", "eTag": "\"1d34d012214157f\"", "properties": { "category": "Cost", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json index 61725c35b0fe..238cea73e79e 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json @@ -10,9 +10,9 @@ "body": { "value": [ { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/TestBudget", + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget", "name": "TestBudget", - "type": "Microsoft.Consumption/budgets", + "type": "Microsoft.CostManagement/budgets", "eTag": "\"1d34d012214157f\"", "properties": { "category": "Cost", @@ -95,9 +95,9 @@ } }, { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget", + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/budgets/TestBudget", "name": "TestBudget", - "type": "Microsoft.Consumption/budgets", + "type": "Microsoft.CostManagement/budgets", "eTag": "\"1d34d012214157f\"", "properties": { "category": "Cost", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json index 587386ffe7d9..0d5b0d929f01 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json @@ -75,9 +75,9 @@ "responses": { "201": { "body": { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/TestBudget", + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget", "name": "TestBudget", - "type": "Microsoft.Consumption/budgets", + "type": "Microsoft.CostManagement/budgets", "eTag": "\"1d34d012214157f\"", "properties": { "category": "Cost", @@ -150,9 +150,9 @@ }, "200": { "body": { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget", + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/budgets/TestBudget", "name": "TestBudget", - "type": "Microsoft.Consumption/budgets", + "type": "Microsoft.CostManagement/budgets", "eTag": "\"1d34d012214157f\"", "properties": { "category": "Cost", From be9112b9f0b0fac3c6f39fba1e4238c169818b82 Mon Sep 17 00:00:00 2001 From: alprosms Date: Thu, 9 Mar 2023 16:10:14 -0800 Subject: [PATCH 19/23] updating min & max length of budget name per conversations with PMs --- .../preview/2023-04-01-preview/costmanagement.budgets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 06bf3b6ae2c2..e754b17646fd 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -581,8 +581,8 @@ "type": "string", "x-ms-parameter-location": "method", "pattern": "^[a-zA-Z0-9_-]+$", - "minLength": 3, - "maxLength": 50 + "minLength": 1, + "maxLength": 63 } } } From 62b6bdea2854294e098f4c7aed7127baa6a58b8d Mon Sep 17 00:00:00 2001 From: alprosms Date: Thu, 9 Mar 2023 16:12:17 -0800 Subject: [PATCH 20/23] Adding suppressions for DeleteOperationResponses, TopLevelResourcesListBySubscription, and NoDuplicatePathsForScopeParameter --- .../cost-management/resource-manager/readme.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 6e0a93ea6f6d..75cba1c438aa 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -269,9 +269,6 @@ input-file: ``` yaml directive: - - suppress: R4011 - from: costmanagement.budgets.json - reason: 'API change needed, The delete operation is defined without a 200 or 204 error response implementation,please add it' - suppress: R4011 from: costmanagement.exports.json reason: 'API change needed, The delete operation is defined without a 200 or 204 error response implementation,please add it' @@ -354,6 +351,19 @@ directive: from: costmanagement.json where: $.definitions.ViewProperties.properties.accumulated reason: 'false alarm ' + + directive: + - suppress: DeleteOperationResponses + from: costmanagement.budgets.json + reason: 'Consistent with delete api from other versions, modifying it will be a breaking change' + - suppress: TopLevelResourcesListBySubscription + from: costmanagement.budgets.json + reason: 'List by subscription is included in the Budgets_List operation with the scope path parameter' + - suppress: NoDuplicatePathsForScopeParameter + from: costmanagement.budgets.json + reason: 'Budgets_Get does not use an explicitly defined scope' + + ``` ### Tag: package-2018-08-preview From 02d8a85cc825d3ff73977162f4e2541ab086a0d7 Mon Sep 17 00:00:00 2001 From: alprosms Date: Thu, 9 Mar 2023 16:25:33 -0800 Subject: [PATCH 21/23] fixing indentation in readme --- specification/cost-management/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 75cba1c438aa..8d1a62fca4ee 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -352,7 +352,7 @@ directive: where: $.definitions.ViewProperties.properties.accumulated reason: 'false alarm ' - directive: +directive: - suppress: DeleteOperationResponses from: costmanagement.budgets.json reason: 'Consistent with delete api from other versions, modifying it will be a breaking change' From c6b879ac0672d6cf03064c3c2d8c0b87b80791ac Mon Sep 17 00:00:00 2001 From: alprosms Date: Thu, 9 Mar 2023 16:49:22 -0800 Subject: [PATCH 22/23] fixing formatting of suppressions in readme --- specification/cost-management/resource-manager/readme.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 8d1a62fca4ee..05f318d2d0e3 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -351,8 +351,6 @@ directive: from: costmanagement.json where: $.definitions.ViewProperties.properties.accumulated reason: 'false alarm ' - -directive: - suppress: DeleteOperationResponses from: costmanagement.budgets.json reason: 'Consistent with delete api from other versions, modifying it will be a breaking change' @@ -362,8 +360,7 @@ directive: - suppress: NoDuplicatePathsForScopeParameter from: costmanagement.budgets.json reason: 'Budgets_Get does not use an explicitly defined scope' - - + ``` ### Tag: package-2018-08-preview From 5ca7147324c6f531e272ff0c0bb98d9b252daa33 Mon Sep 17 00:00:00 2001 From: alprosms Date: Thu, 9 Mar 2023 18:05:56 -0800 Subject: [PATCH 23/23] Adding paging back in, specifying as null for future use --- .../2023-04-01-preview/costmanagement.budgets.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index e754b17646fd..0252360f047b 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -70,6 +70,9 @@ "$ref": "common-types.json#/definitions/ErrorResponse" } } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, @@ -220,6 +223,11 @@ "items": { "$ref": "#/definitions/Budget" } + }, + "nextLink": { + "description": "The link (url) to the next page of results.\r\nIt's null for now, added for future use.", + "type": "string", + "readOnly": true } } },