Skip to content

Commit

Permalink
Merge pull request #2862 from Azure/ant/onboard_advisor
Browse files Browse the repository at this point in the history
Onboard Microsoft.Advisor to autogeneration
  • Loading branch information
anthony-c-martin authored Apr 10, 2023
2 parents 2339f74 + cab64b9 commit d4fb70b
Show file tree
Hide file tree
Showing 18 changed files with 725 additions and 146 deletions.
37 changes: 21 additions & 16 deletions generator/autogenlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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[] {
Expand Down
8 changes: 4 additions & 4 deletions schemas/2014-04-01-preview/deploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions schemas/2016-07-12-preview/Microsoft.Advisor.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -47,7 +48,7 @@
"type": {
"type": "string",
"enum": [
"Microsoft.Advisor/suppressions"
"Microsoft.Advisor/recommendations/suppressions"
]
}
},
Expand All @@ -56,7 +57,7 @@
"name",
"type"
],
"description": "Microsoft.Advisor/suppressions"
"description": "Microsoft.Advisor/recommendations/suppressions"
}
},
"definitions": {}
Expand Down
7 changes: 4 additions & 3 deletions schemas/2017-03-31/Microsoft.Advisor.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -31,7 +32,7 @@
"type": {
"type": "string",
"enum": [
"Microsoft.Advisor/suppressions"
"Microsoft.Advisor/recommendations/suppressions"
]
}
},
Expand All @@ -41,7 +42,7 @@
"properties",
"type"
],
"description": "Microsoft.Advisor/suppressions"
"description": "Microsoft.Advisor/recommendations/suppressions"
}
},
"definitions": {
Expand Down
42 changes: 22 additions & 20 deletions schemas/2017-04-19/Microsoft.Advisor.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@
"type"
],
"description": "Microsoft.Advisor/configurations"
},
"recommendations_suppressions": {
}
},
"subscription_resourceDefinitions": {
"configurations": {
"type": "object",
"properties": {
"apiVersion": {
Expand All @@ -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"
]
}
},
Expand All @@ -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": {
Expand All @@ -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"
]
}
},
Expand All @@ -133,7 +135,7 @@
"properties",
"type"
],
"description": "Microsoft.Advisor/configurations"
"description": "Microsoft.Advisor/recommendations/suppressions"
}
},
"definitions": {
Expand Down
24 changes: 24 additions & 0 deletions schemas/2018-05-01/subscriptionDeploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
6 changes: 0 additions & 6 deletions schemas/2019-04-01/deploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
18 changes: 18 additions & 0 deletions schemas/2019-08-01/managementGroupDeploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
18 changes: 18 additions & 0 deletions schemas/2019-08-01/tenantDeploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
Loading

0 comments on commit d4fb70b

Please sign in to comment.