diff --git a/generator/autogenlist.ts b/generator/autogenlist.ts index 4623484f20..892d6d3733 100644 --- a/generator/autogenlist.ts +++ b/generator/autogenlist.ts @@ -19,11 +19,6 @@ import { lowerCaseEquals } from './utils'; // New providers are onboarded by default. The providers listed here are the only ones **not** onboarded. const disabledProviders: AutoGenConfig[] = [ - { - basePath: 'advisor/resource-manager', - namespace: 'Microsoft.Advisor', - disabledForAutogen: true, - }, { basePath: 'cloudshell/resource-manager', namespace: 'Microsoft.Portal', @@ -46,6 +41,12 @@ const disabledProviders: AutoGenConfig[] = [ disabledForAutogen: true, suffix: 'DNS', }, + { + basePath: 'privatedns/resource-manager', + namespace: 'Microsoft.Network', + disabledForAutogen: true, + suffix: 'privateDns', + }, { // Disabled as the swagger spec contains a bug (enum mismatch) basePath: 'edgeorderpartner/resource-manager', @@ -67,22 +68,11 @@ const disabledProviders: AutoGenConfig[] = [ namespace: 'Microsoft.OperationsManagement', disabledForAutogen: true, }, - { - basePath: 'privatedns/resource-manager', - namespace: 'Microsoft.Network', - disabledForAutogen: true, - suffix: 'privateDns', - }, { basePath: 'service-map/resource-manager', namespace: 'Microsoft.OperationalInsights', disabledForAutogen: true, }, - { - basePath: 'trafficmanager/resource-manager', - namespace: 'Microsoft.Network', - suffix: 'TrafficManager', - }, { basePath: 'videoanalyzer/resource-manager', namespace: 'Microsoft.Media', @@ -1096,6 +1086,11 @@ const autoGenList: AutoGenConfig[] = [ namespace: 'Microsoft.Media', postProcessor: mediaPostProcessor }, + { + basePath: 'trafficmanager/resource-manager', + namespace: 'Microsoft.Network', + suffix: 'TrafficManager', + }, { basePath: 'network/resource-manager', namespace: 'Microsoft.Network', @@ -1112,6 +1107,16 @@ const autoGenList: AutoGenConfig[] = [ namespace: 'Microsoft.AzureStackHCI', postProcessor: azureStackHciPostProcessor }, + { + basePath: 'advisor/resource-manager', + namespace: 'Microsoft.Advisor', + resourceConfig: [ + { + type: 'recommendations/suppressions', + scopes: ScopeType.Tenant | ScopeType.ManagementGroup | ScopeType.Subscription | ScopeType.ResourceGroup | ScopeType.Extension, + }, + ] + }, ]; export function findAutogenEntries(basePath: string): AutoGenConfig[] { diff --git a/schemas/2014-04-01-preview/deploymentTemplate.json b/schemas/2014-04-01-preview/deploymentTemplate.json index 1c46743fbe..6cec0b0a8f 100644 --- a/schemas/2014-04-01-preview/deploymentTemplate.json +++ b/schemas/2014-04-01-preview/deploymentTemplate.json @@ -6090,19 +6090,19 @@ "$ref": "https://schema.management.azure.com/schemas/2018-09-01-preview/Microsoft.ResourceGraph.json#/resourceDefinitions/queries" }, { - "$ref": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" + "$ref": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" }, { - "$ref": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" + "$ref": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" }, { - "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" + "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" }, { "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/resourceDefinitions/configurations" }, { - "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" + "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" }, { "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/resourceDefinitions/configurations" diff --git a/schemas/2016-07-12-preview/Microsoft.Advisor.json b/schemas/2016-07-12-preview/Microsoft.Advisor.json index 63026dcf0e..19de15fd0c 100644 --- a/schemas/2016-07-12-preview/Microsoft.Advisor.json +++ b/schemas/2016-07-12-preview/Microsoft.Advisor.json @@ -3,7 +3,8 @@ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Microsoft.Advisor", "description": "Microsoft Advisor Resource Types", - "resourceDefinitions": { + "resourceDefinitions": {}, + "unknown_resourceDefinitions": { "recommendations_suppressions": { "type": "object", "properties": { @@ -47,7 +48,7 @@ "type": { "type": "string", "enum": [ - "Microsoft.Advisor/suppressions" + "Microsoft.Advisor/recommendations/suppressions" ] } }, @@ -56,7 +57,7 @@ "name", "type" ], - "description": "Microsoft.Advisor/suppressions" + "description": "Microsoft.Advisor/recommendations/suppressions" } }, "definitions": {} diff --git a/schemas/2017-03-31/Microsoft.Advisor.json b/schemas/2017-03-31/Microsoft.Advisor.json index 36b381716f..23bc792eb1 100644 --- a/schemas/2017-03-31/Microsoft.Advisor.json +++ b/schemas/2017-03-31/Microsoft.Advisor.json @@ -3,7 +3,8 @@ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Microsoft.Advisor", "description": "Microsoft Advisor Resource Types", - "resourceDefinitions": { + "resourceDefinitions": {}, + "unknown_resourceDefinitions": { "recommendations_suppressions": { "type": "object", "properties": { @@ -31,7 +32,7 @@ "type": { "type": "string", "enum": [ - "Microsoft.Advisor/suppressions" + "Microsoft.Advisor/recommendations/suppressions" ] } }, @@ -41,7 +42,7 @@ "properties", "type" ], - "description": "Microsoft.Advisor/suppressions" + "description": "Microsoft.Advisor/recommendations/suppressions" } }, "definitions": { diff --git a/schemas/2017-04-19/Microsoft.Advisor.json b/schemas/2017-04-19/Microsoft.Advisor.json index 68ac57d627..d93b4f5ab8 100644 --- a/schemas/2017-04-19/Microsoft.Advisor.json +++ b/schemas/2017-04-19/Microsoft.Advisor.json @@ -48,8 +48,10 @@ "type" ], "description": "Microsoft.Advisor/configurations" - }, - "recommendations_suppressions": { + } + }, + "subscription_resourceDefinitions": { + "configurations": { "type": "object", "properties": { "apiVersion": { @@ -58,25 +60,31 @@ "2017-04-19" ] }, + "id": { + "type": "string", + "description": "The resource Id of the configuration resource." + }, "name": { "type": "string", - "description": "The name of the suppression." + "enum": [ + "configurations" + ] }, "properties": { "oneOf": [ { - "$ref": "#/definitions/SuppressionProperties" + "$ref": "#/definitions/ConfigDataProperties" }, { "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "The properties of the suppression." + "description": "The list of property name/value pairs." }, "type": { "type": "string", "enum": [ - "Microsoft.Advisor/suppressions" + "Microsoft.Advisor/configurations" ] } }, @@ -86,11 +94,11 @@ "properties", "type" ], - "description": "Microsoft.Advisor/suppressions" + "description": "Microsoft.Advisor/configurations" } }, - "subscription_resourceDefinitions": { - "configurations": { + "unknown_resourceDefinitions": { + "recommendations_suppressions": { "type": "object", "properties": { "apiVersion": { @@ -99,31 +107,25 @@ "2017-04-19" ] }, - "id": { - "type": "string", - "description": "The resource Id of the configuration resource." - }, "name": { "type": "string", - "enum": [ - "configurations" - ] + "description": "The name of the suppression." }, "properties": { "oneOf": [ { - "$ref": "#/definitions/ConfigDataProperties" + "$ref": "#/definitions/SuppressionProperties" }, { "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "The list of property name/value pairs." + "description": "The properties of the suppression." }, "type": { "type": "string", "enum": [ - "Microsoft.Advisor/configurations" + "Microsoft.Advisor/recommendations/suppressions" ] } }, @@ -133,7 +135,7 @@ "properties", "type" ], - "description": "Microsoft.Advisor/configurations" + "description": "Microsoft.Advisor/recommendations/suppressions" } }, "definitions": { diff --git a/schemas/2018-05-01/subscriptionDeploymentTemplate.json b/schemas/2018-05-01/subscriptionDeploymentTemplate.json index 2d48a7d457..31cecdefed 100644 --- a/schemas/2018-05-01/subscriptionDeploymentTemplate.json +++ b/schemas/2018-05-01/subscriptionDeploymentTemplate.json @@ -506,12 +506,36 @@ { "$ref": "https://schema.management.azure.com/schemas/2018-03-01/Microsoft.Addons.json#/subscription_resourceDefinitions/supportProviders_supportPlanTypes" }, + { + "$ref": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/subscription_resourceDefinitions/configurations" }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/subscription_resourceDefinitions/configurations" }, + { + "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-09-01/Microsoft.Advisor.json#/subscription_resourceDefinitions/configurations" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-09-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-10-01/Microsoft.Advisor.json#/subscription_resourceDefinitions/configurations" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-10-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2015-07-01/Microsoft.Authorization.Authz.json#/unknown_resourceDefinitions/roleAssignments" }, diff --git a/schemas/2019-04-01/deploymentTemplate.json b/schemas/2019-04-01/deploymentTemplate.json index 0f9e982a8c..0cd40248e5 100644 --- a/schemas/2019-04-01/deploymentTemplate.json +++ b/schemas/2019-04-01/deploymentTemplate.json @@ -642,12 +642,6 @@ { "$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/resourceDefinitions/registrationAssignments" }, { "$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/resourceDefinitions/registrationDefinitions" }, { "$ref": "https://schema.management.azure.com/schemas/2018-09-01-preview/Microsoft.BareMetal.json#/resourceDefinitions/crayServers" }, - { "$ref": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" }, - { "$ref": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" }, - { "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" }, - { "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/resourceDefinitions/configurations" }, - { "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions" }, - { "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/resourceDefinitions/configurations" }, { "$ref": "https://schema.management.azure.com/schemas/2014-04-01/Microsoft.Insights.ManuallyAuthored.json#/resourceDefinitions/components" }, { "$ref": "https://schema.management.azure.com/schemas/2014-04-01/Microsoft.Insights.ManuallyAuthored.json#/resourceDefinitions/webtests" }, { "$ref": "https://schema.management.azure.com/schemas/2014-04-01/Microsoft.Insights.ManuallyAuthored.json#/resourceDefinitions/autoscalesettings" }, diff --git a/schemas/2019-08-01/managementGroupDeploymentTemplate.json b/schemas/2019-08-01/managementGroupDeploymentTemplate.json index 621f826b49..39c39416ff 100644 --- a/schemas/2019-08-01/managementGroupDeploymentTemplate.json +++ b/schemas/2019-08-01/managementGroupDeploymentTemplate.json @@ -500,6 +500,24 @@ }, { "oneOf": [ + { + "$ref": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-09-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-10-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2023-04-01-preview/Microsoft.AlertsManagement.json#/managementGroup_resourceDefinitions/tenantActivityLogAlerts" }, diff --git a/schemas/2019-08-01/tenantDeploymentTemplate.json b/schemas/2019-08-01/tenantDeploymentTemplate.json index e5f255cae6..40e8932288 100644 --- a/schemas/2019-08-01/tenantDeploymentTemplate.json +++ b/schemas/2019-08-01/tenantDeploymentTemplate.json @@ -508,6 +508,24 @@ { "$ref": "https://schema.management.azure.com/schemas/2017-04-01-preview/Microsoft.Aadiam.json#/tenant_resourceDefinitions/diagnosticSettings" }, + { + "$ref": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-09-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-10-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2022-11-16-preview/Microsoft.AppComplianceAutomation.json#/tenant_resourceDefinitions/reports" }, diff --git a/schemas/2020-01-01/Microsoft.Advisor.json b/schemas/2020-01-01/Microsoft.Advisor.json index 043a959b25..26cc1b38ca 100644 --- a/schemas/2020-01-01/Microsoft.Advisor.json +++ b/schemas/2020-01-01/Microsoft.Advisor.json @@ -45,8 +45,10 @@ "type" ], "description": "Microsoft.Advisor/configurations" - }, - "recommendations_suppressions": { + } + }, + "subscription_resourceDefinitions": { + "configurations": { "type": "object", "properties": { "apiVersion": { @@ -57,23 +59,26 @@ }, "name": { "type": "string", - "description": "The name of the suppression." + "enum": [ + "default" + ], + "description": "Advisor configuration name. Value must be 'default'" }, "properties": { "oneOf": [ { - "$ref": "#/definitions/SuppressionProperties" + "$ref": "#/definitions/ConfigDataProperties" }, { "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "The properties of the suppression." + "description": "Configuration data properties" }, "type": { "type": "string", "enum": [ - "Microsoft.Advisor/suppressions" + "Microsoft.Advisor/configurations" ] } }, @@ -83,11 +88,11 @@ "properties", "type" ], - "description": "Microsoft.Advisor/suppressions" + "description": "Microsoft.Advisor/configurations" } }, - "subscription_resourceDefinitions": { - "configurations": { + "unknown_resourceDefinitions": { + "recommendations_suppressions": { "type": "object", "properties": { "apiVersion": { @@ -98,26 +103,23 @@ }, "name": { "type": "string", - "enum": [ - "default" - ], - "description": "Advisor configuration name. Value must be 'default'" + "description": "The name of the suppression." }, "properties": { "oneOf": [ { - "$ref": "#/definitions/ConfigDataProperties" + "$ref": "#/definitions/SuppressionProperties" }, { "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" } ], - "description": "Configuration data properties" + "description": "The properties of the suppression." }, "type": { "type": "string", "enum": [ - "Microsoft.Advisor/configurations" + "Microsoft.Advisor/recommendations/suppressions" ] } }, @@ -127,7 +129,7 @@ "properties", "type" ], - "description": "Microsoft.Advisor/configurations" + "description": "Microsoft.Advisor/recommendations/suppressions" } }, "definitions": { diff --git a/schemas/2022-09-01/Microsoft.Advisor.json b/schemas/2022-09-01/Microsoft.Advisor.json new file mode 100644 index 0000000000..25aca7c8dd --- /dev/null +++ b/schemas/2022-09-01/Microsoft.Advisor.json @@ -0,0 +1,283 @@ +{ + "id": "https://schema.management.azure.com/schemas/2022-09-01/Microsoft.Advisor.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.Advisor", + "description": "Microsoft Advisor Resource Types", + "resourceDefinitions": { + "configurations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2022-09-01" + ] + }, + "name": { + "type": "string", + "enum": [ + "default" + ], + "description": "Advisor configuration name. Value must be 'default'" + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/ConfigDataProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Configuration data properties" + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Advisor/configurations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.Advisor/configurations" + } + }, + "subscription_resourceDefinitions": { + "configurations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2022-09-01" + ] + }, + "name": { + "type": "string", + "enum": [ + "default" + ], + "description": "Advisor configuration name. Value must be 'default'" + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/ConfigDataProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Configuration data properties" + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Advisor/configurations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.Advisor/configurations" + } + }, + "unknown_resourceDefinitions": { + "recommendations_suppressions": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2022-09-01" + ] + }, + "name": { + "type": "string", + "description": "The name of the suppression." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/SuppressionProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The properties of the suppression." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Advisor/recommendations/suppressions" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.Advisor/recommendations/suppressions" + } + }, + "definitions": { + "ConfigDataProperties": { + "type": "object", + "properties": { + "digests": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/DigestConfig" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Advisor digest configuration. Valid only for subscriptions" + }, + "duration": { + "oneOf": [ + { + "type": "string", + "enum": [ + "7", + "14", + "21", + "30", + "60", + "90" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Minimum duration for Advisor low CPU utilization evaluation. Valid only for subscriptions. Valid values: 7 (default), 14, 21, 30, 60 or 90." + }, + "exclude": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Exclude the resource from Advisor evaluations. Valid values: False (default) or True." + }, + "lowCpuThreshold": { + "oneOf": [ + { + "type": "string", + "enum": [ + "5", + "10", + "15", + "20" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid only for subscriptions. Valid values: 5 (default), 10, 15 or 20." + } + }, + "description": "Configuration data properties" + }, + "DigestConfig": { + "type": "object", + "properties": { + "actionGroupResourceId": { + "type": "string", + "description": "Action group resource id used by digest." + }, + "categories": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "HighAvailability", + "Security", + "Performance", + "Cost", + "OperationalExcellence" + ] + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Categories to send digest for. If categories are not provided, then digest will be sent for all categories." + }, + "frequency": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Frequency that digest will be triggered, in days. Value must be between 7 and 30 days inclusive." + }, + "language": { + "type": "string", + "description": "Language for digest content body. Value must be ISO 639-1 code for one of Azure portal supported languages. Otherwise, it will be converted into one. Default value is English (en)." + }, + "name": { + "type": "string", + "description": "Name of digest configuration. Value is case-insensitive and must be unique within a subscription." + }, + "state": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Active", + "Disabled" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "State of digest configuration." + } + }, + "description": "Advisor Digest configuration entity" + }, + "SuppressionProperties": { + "type": "object", + "properties": { + "suppressionId": { + "type": "string", + "description": "The GUID of the suppression." + }, + "ttl": { + "type": "string", + "description": "The duration for which the suppression is valid." + } + }, + "description": "The properties of the suppression." + } + } +} \ No newline at end of file diff --git a/schemas/2022-10-01/Microsoft.Advisor.json b/schemas/2022-10-01/Microsoft.Advisor.json new file mode 100644 index 0000000000..5c69f799db --- /dev/null +++ b/schemas/2022-10-01/Microsoft.Advisor.json @@ -0,0 +1,283 @@ +{ + "id": "https://schema.management.azure.com/schemas/2022-10-01/Microsoft.Advisor.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.Advisor", + "description": "Microsoft Advisor Resource Types", + "resourceDefinitions": { + "configurations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2022-10-01" + ] + }, + "name": { + "type": "string", + "enum": [ + "default" + ], + "description": "Advisor configuration name. Value must be 'default'" + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/ConfigDataProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Configuration data properties" + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Advisor/configurations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.Advisor/configurations" + } + }, + "subscription_resourceDefinitions": { + "configurations": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2022-10-01" + ] + }, + "name": { + "type": "string", + "enum": [ + "default" + ], + "description": "Advisor configuration name. Value must be 'default'" + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/ConfigDataProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Configuration data properties" + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Advisor/configurations" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.Advisor/configurations" + } + }, + "unknown_resourceDefinitions": { + "recommendations_suppressions": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2022-10-01" + ] + }, + "name": { + "type": "string", + "description": "The name of the suppression." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/SuppressionProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The properties of the suppression." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.Advisor/recommendations/suppressions" + ] + } + }, + "required": [ + "apiVersion", + "name", + "properties", + "type" + ], + "description": "Microsoft.Advisor/recommendations/suppressions" + } + }, + "definitions": { + "ConfigDataProperties": { + "type": "object", + "properties": { + "digests": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/DigestConfig" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Advisor digest configuration. Valid only for subscriptions" + }, + "duration": { + "oneOf": [ + { + "type": "string", + "enum": [ + "7", + "14", + "21", + "30", + "60", + "90" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Minimum duration for Advisor low CPU utilization evaluation. Valid only for subscriptions. Valid values: 7 (default), 14, 21, 30, 60 or 90." + }, + "exclude": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Exclude the resource from Advisor evaluations. Valid values: False (default) or True." + }, + "lowCpuThreshold": { + "oneOf": [ + { + "type": "string", + "enum": [ + "5", + "10", + "15", + "20" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Minimum percentage threshold for Advisor low CPU utilization evaluation. Valid only for subscriptions. Valid values: 5 (default), 10, 15 or 20." + } + }, + "description": "Configuration data properties" + }, + "DigestConfig": { + "type": "object", + "properties": { + "actionGroupResourceId": { + "type": "string", + "description": "Action group resource id used by digest." + }, + "categories": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "HighAvailability", + "Security", + "Performance", + "Cost", + "OperationalExcellence" + ] + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Categories to send digest for. If categories are not provided, then digest will be sent for all categories." + }, + "frequency": { + "oneOf": [ + { + "type": "integer" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Frequency that digest will be triggered, in days. Value must be between 7 and 30 days inclusive." + }, + "language": { + "type": "string", + "description": "Language for digest content body. Value must be ISO 639-1 code for one of Azure portal supported languages. Otherwise, it will be converted into one. Default value is English (en)." + }, + "name": { + "type": "string", + "description": "Name of digest configuration. Value is case-insensitive and must be unique within a subscription." + }, + "state": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Active", + "Disabled" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "State of digest configuration." + } + }, + "description": "Advisor Digest configuration entity" + }, + "SuppressionProperties": { + "type": "object", + "properties": { + "suppressionId": { + "type": "string", + "description": "The GUID of the suppression." + }, + "ttl": { + "type": "string", + "description": "The duration for which the suppression is valid." + } + }, + "description": "The properties of the suppression." + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index 7159adef3e..3fb4fb04f5 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -61,12 +61,36 @@ { "$ref": "https://schema.management.azure.com/schemas/2020-07-01-preview/Microsoft.Aadiam.json#/resourceDefinitions/azureADMetrics" }, + { + "$ref": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/resourceDefinitions/configurations" }, + { + "$ref": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/resourceDefinitions/configurations" }, + { + "$ref": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-09-01/Microsoft.Advisor.json#/resourceDefinitions/configurations" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-09-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-10-01/Microsoft.Advisor.json#/resourceDefinitions/configurations" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2022-10-01/Microsoft.Advisor.json#/unknown_resourceDefinitions/recommendations_suppressions" + }, { "$ref": "https://schema.management.azure.com/schemas/2020-05-12-preview/Microsoft.AgFoodPlatform.json#/resourceDefinitions/farmBeats" }, diff --git a/tests/2016-07-12-preview/Microsoft.Advisor.Suppression.json b/tests/2016-07-12-preview/Microsoft.Advisor.Suppression.json deleted file mode 100644 index 07192e6877..0000000000 --- a/tests/2016-07-12-preview/Microsoft.Advisor.Suppression.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "tests": [ - { - "name": "Suppression - create", - "definition": "https://schema.management.azure.com/schemas/2016-07-12-preview/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions", - "expectedErrors": [], - "json": { - "apiVersion": "2016-07-12-preview", - "type": "Microsoft.Advisor/suppressions", - "id": "/resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1", - "name": "suppressionName1", - "properties": { - "suppressionId": "suppresionId", - "ttl": "07:00:00:00" - } - } - } - ] - } \ No newline at end of file diff --git a/tests/2017-03-31/Microsoft.Advisor.Suppression.json b/tests/2017-03-31/Microsoft.Advisor.Suppression.json deleted file mode 100644 index e2b921675b..0000000000 --- a/tests/2017-03-31/Microsoft.Advisor.Suppression.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "tests": [ - { - "name": "Suppression - create", - "definition": "https://schema.management.azure.com/schemas/2017-03-31/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions", - "expectedErrors": [], - "json": { - "apiVersion": "2017-03-31", - "type": "Microsoft.Advisor/suppressions", - "id": "/resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1", - "name": "suppressionName1", - "properties": { - "suppressionId": "suppresionId", - "ttl": "07:00:00:00" - } - } - } - ] - } \ No newline at end of file diff --git a/tests/2017-04-19/Microsoft.Advisor.Suppression.json b/tests/2017-04-19/Microsoft.Advisor.Suppression.json deleted file mode 100644 index 5b937ae779..0000000000 --- a/tests/2017-04-19/Microsoft.Advisor.Suppression.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "tests": [ - { - "name": "Suppression - create", - "definition": "https://schema.management.azure.com/schemas/2017-04-19/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions", - "expectedErrors": [], - "json": { - "apiVersion": "2017-04-19", - "type": "Microsoft.Advisor/suppressions", - "id": "/resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1", - "name": "suppressionName1", - "properties": { - "suppressionId": "suppresionId", - "ttl": "07:00:00:00" - } - } - } - ] - } \ No newline at end of file diff --git a/tests/2020-01-01/Microsoft.Advisor.Suppression.json b/tests/2020-01-01/Microsoft.Advisor.Suppression.json deleted file mode 100644 index 727766cb42..0000000000 --- a/tests/2020-01-01/Microsoft.Advisor.Suppression.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "tests": [ - { - "name": "Suppression - create", - "definition": "https://schema.management.azure.com/schemas/2020-01-01/Microsoft.Advisor.json#/resourceDefinitions/recommendations_suppressions", - "expectedErrors": [], - "json": { - "apiVersion": "2020-01-01", - "type": "Microsoft.Advisor/suppressions", - "id": "/resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1", - "name": "suppressionName1", - "properties": { - "suppressionId": "suppresionId", - "ttl": "07:00:00:00" - } - } - } - ] - } \ No newline at end of file diff --git a/tools/tests.ts b/tools/tests.ts index 704d57ec36..9d3e153181 100644 --- a/tools/tests.ts +++ b/tools/tests.ts @@ -213,7 +213,7 @@ describe('Run individual schema test', () => { describe('Validate test templates against VSCode language service', () => { for (const templateTestFile of templateTestPaths) { it(`running schema validation on '${templateTestFile}'`, async function() { - this.timeout(30000); + this.timeout(60000); const service = getLanguageService({ schemaRequestService: loadRawSchema,