From c920de462102c547cf3ec21a33868a68840ff362 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 28 Apr 2021 19:06:54 +0000 Subject: [PATCH] CodeGen from PR 13658 in Azure/azure-rest-api-specs Merge c67b0387144cabcf4bf54d4cd7f7c35397f45fb5 into 88d9023117ea3bfae404a44b755ca7f0bf81b806 --- .../subscriptionDeploymentTemplate.json | 3 + schemas/2021-05-01/Microsoft.Consumption.json | 396 ++++++++++++++++++ schemas/common/autogeneratedResources.json | 3 + 3 files changed, 402 insertions(+) create mode 100644 schemas/2021-05-01/Microsoft.Consumption.json diff --git a/schemas/2018-05-01/subscriptionDeploymentTemplate.json b/schemas/2018-05-01/subscriptionDeploymentTemplate.json index beb002309f..344cadf44e 100644 --- a/schemas/2018-05-01/subscriptionDeploymentTemplate.json +++ b/schemas/2018-05-01/subscriptionDeploymentTemplate.json @@ -198,6 +198,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2019-11-01/Microsoft.Consumption.json#/unknown_resourceDefinitions/budgets" }, + { + "$ref": "https://schema.management.azure.com/schemas/2021-05-01/Microsoft.Consumption.json#/unknown_resourceDefinitions/budgets" + }, { "$ref": "https://schema.management.azure.com/schemas/2020-02-01-preview/Microsoft.Datadog.json#/subscription_resourceDefinitions/agreements" }, diff --git a/schemas/2021-05-01/Microsoft.Consumption.json b/schemas/2021-05-01/Microsoft.Consumption.json new file mode 100644 index 0000000000..32ccbbcd36 --- /dev/null +++ b/schemas/2021-05-01/Microsoft.Consumption.json @@ -0,0 +1,396 @@ +{ + "id": "https://schema.management.azure.com/schemas/2021-05-01/Microsoft.Consumption.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.Consumption", + "description": "Microsoft Consumption Resource Types", + "resourceDefinitions": {}, + "unknown_resourceDefinitions": { + "budgets": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2021-05-01" + ] + }, + "eTag": { + "type": "string", + "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." + }, + "name": { + "type": "string", + "description": "Budget Name." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The properties of the budget." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Consumption/budgets" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.Consumption/budgets" + } + }, + "definitions": { + "BudgetComparisonExpression": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the column to use in comparison." + }, + "operator": { + "oneOf": [ + { + "type": "string", + "enum": [ + "In" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The operator to use for comparison." + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Array of values to use for comparison" + } + }, + "required": [ + "name", + "operator", + "values" + ], + "description": "The comparison expression to be used in the budgets." + }, + "BudgetFilter": { + "type": "object", + "properties": { + "and": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/BudgetFilterProperties" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The logical \"AND\" expression. Must have at least 2 items." + }, + "dimensions": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetComparisonExpression" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The comparison expression to be used in the budgets." + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetFilterProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The Dimensions or Tags to filter a budget by." + }, + "tags": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetComparisonExpression" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The comparison expression to be used in the budgets." + } + }, + "description": "May be used to filter budgets by resource group, resource, or meter." + }, + "BudgetFilterProperties": { + "type": "object", + "properties": { + "dimensions": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetComparisonExpression" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The comparison expression to be used in the budgets." + }, + "tags": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetComparisonExpression" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The comparison expression to be used in the budgets." + } + }, + "description": "The Dimensions or Tags to filter a budget by." + }, + "BudgetProperties": { + "type": "object", + "properties": { + "amount": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The total amount of cost to track with the budget" + }, + "category": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Cost" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The category of the budget, whether the budget tracks cost or usage." + }, + "filter": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetFilter" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "May be used to filter budgets by resource group, resource, or meter." + }, + "notifications": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Notification" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications." + }, + "timeGrain": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Monthly", + "Quarterly", + "Annually", + "BillingMonth", + "BillingQuarter", + "BillingAnnual" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "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." + }, + "timePeriod": { + "oneOf": [ + { + "$ref": "#/definitions/BudgetTimePeriod" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The start and end date for a budget." + } + }, + "required": [ + "amount", + "category", + "timeGrain", + "timePeriod" + ], + "description": "The properties of the budget." + }, + "BudgetTimePeriod": { + "type": "object", + "properties": { + "endDate": { + "type": "string", + "format": "date-time", + "description": "The end date for the budget. If not provided, we default this to 10 years from the start date." + }, + "startDate": { + "type": "string", + "format": "date-time", + "description": "The start date for the budget." + } + }, + "required": [ + "startDate" + ], + "description": "The start and end date for a budget." + }, + "Notification": { + "type": "object", + "properties": { + "contactEmails": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "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." + }, + "contactGroups": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "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." + }, + "contactRoles": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Contact roles to send the budget notification to when the threshold is exceeded." + }, + "enabled": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The notification is enabled or not." + }, + "operator": { + "oneOf": [ + { + "type": "string", + "enum": [ + "EqualTo", + "GreaterThan", + "GreaterThanOrEqualTo" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The comparison operator." + }, + "threshold": { + "oneOf": [ + { + "type": "number" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "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." + }, + "thresholdType": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Actual" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The type of threshold." + } + }, + "required": [ + "contactEmails", + "enabled", + "operator", + "threshold" + ], + "description": "The notification associated with a budget." + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index a84d984326..df54c26c56 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -2359,6 +2359,9 @@ { "$ref": "https://schema.management.azure.com/schemas/2019-11-01/Microsoft.Consumption.json#/unknown_resourceDefinitions/budgets" }, + { + "$ref": "https://schema.management.azure.com/schemas/2021-05-01/Microsoft.Consumption.json#/unknown_resourceDefinitions/budgets" + }, { "$ref": "https://schema.management.azure.com/schemas/2017-08-01-preview/Microsoft.ContainerInstance.json#/resourceDefinitions/containerGroups" },