diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionEndpoints_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionEndpoints_API.json index 77b785c40fa4..e801c79d733e 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionEndpoints_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionEndpoints_API.json @@ -50,7 +50,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -92,7 +92,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -140,7 +140,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -200,7 +200,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -254,7 +254,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -297,7 +297,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRuleAssociations_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRuleAssociations_API.json index 61ae89f8e81e..f76cf64b8e04 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRuleAssociations_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRuleAssociations_API.json @@ -47,7 +47,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -95,7 +95,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -140,7 +140,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -197,7 +197,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, @@ -237,7 +237,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2" } } }, diff --git a/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRules_API.json b/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRules_API.json index 35355020ccc7..c79465ce4dd1 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRules_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRules_API.json @@ -50,7 +50,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseCommonV2" } } }, @@ -92,7 +92,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseCommonV2" } } }, @@ -140,7 +140,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseCommonV2" } } }, @@ -200,7 +200,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseCommonV2" } } }, @@ -254,7 +254,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseCommonV2" } } }, @@ -297,7 +297,7 @@ "default": { "description": "Error", "schema": { - "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseCommonV2" } } }, @@ -821,6 +821,17 @@ } } } + }, + "ErrorResponseCommonV2": { + "title": "Error response", + "description": "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).", + "type": "object", + "properties": { + "error": { + "description": "The error object.", + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorDetail" + } + } } }, "parameters": { diff --git a/specification/monitor/resource-manager/readme.csharp.md b/specification/monitor/resource-manager/readme.csharp.md index 4c45821ceb70..433c37d8dccc 100644 --- a/specification/monitor/resource-manager/readme.csharp.md +++ b/specification/monitor/resource-manager/readme.csharp.md @@ -44,4 +44,12 @@ output-folder: $(csharp-sdks-folder)/$(csharp-profile)/Monitor/Management.Monito batch: - tag: profile-hybrid-2020-09-01 - ``` \ No newline at end of file + ``` + +## Local Development + +### Auto Generation +- Fork https://github.com/Azure/azure-rest-api-specs, clone it (asumming at C:\Repos) +- Fork https://github.com/Azure/azure-sdk-for-net, clone it (asumming at C:\Repos) +- Make changes +- autorest --version=V2 --csharp --reflect-api-versions --license-header=MICROSOFT_MIT_NO_VERSION --use=@microsoft.azure/autorest.csharp@2.3.82 --csharp-sdks-folder=C:\Repos\azure-sdk-for-net\sdk C:\Repos\azure-rest-api-specs\specification\monitor\resource-manager\readme.md --debug \ No newline at end of file diff --git a/specification/monitor/resource-manager/readme.go.md b/specification/monitor/resource-manager/readme.go.md index 518dbd0706d2..e72aeed0643f 100644 --- a/specification/monitor/resource-manager/readme.go.md +++ b/specification/monitor/resource-manager/readme.go.md @@ -21,6 +21,7 @@ batch: - tag: package-2019-06 - tag: package-2019-11 - tag: package-2020-10-only + - tag: package-2021-04 ``` ### Tag: package-2017-09 and go @@ -94,3 +95,53 @@ Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-2021-04' && $(go) +output-folder: $(go-sdk-folder)/services/preview/monitor/mgmt/2021-04-01-preview/$(namespace) +directive: +- from: activityLogAlerts_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: guestDiagnosticSettings_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: guestDiagnosticSettingsAssociation_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: privateLinkScopes_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: scheduledQueryRule_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: autoscale_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: alertRules_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: alertRulesIncidents_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: actionGroups_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: metricAlert_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +``` \ No newline at end of file diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 556f4e3fa94c..7fbc0cc00cc1 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -40,7 +40,38 @@ title: MonitorManagementClient ``` yaml description: Monitor Management Client openapi-type: arm -tag: package-2020-03 +tag: package-2021-04 +``` + +### Tag: package-2021-04 + +These settings apply only when `--tag=package-2021-04` is specified on the command line. + +``` yaml $(tag) == 'package-2021-04' +input-file: +- Microsoft.Insights/stable/2015-04-01/autoscale_API.json +- Microsoft.Insights/stable/2015-04-01/operations_API.json +- Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json +- Microsoft.Insights/stable/2016-03-01/alertRules_API.json +- Microsoft.Insights/stable/2016-03-01/logProfiles_API.json +- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettings_API.json +- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettingsCategories_API.json +- Microsoft.Insights/stable/2019-06-01/actionGroups_API.json +- Microsoft.Insights/stable/2015-04-01/activityLogs_API.json +- Microsoft.Insights/stable/2015-04-01/eventCategories_API.json +- Microsoft.Insights/stable/2015-04-01/tenantActivityLogs_API.json +- Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json +- Microsoft.Insights/stable/2018-01-01/metrics_API.json +- Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json +- Microsoft.Insights/stable/2018-03-01/metricAlert_API.json +- Microsoft.Insights/stable/2018-04-16/scheduledQueryRule_API.json +- Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json +- Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json +- Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json +- Microsoft.Insights/stable/2017-04-01/activityLogAlerts_API.json +- Microsoft.Insights/stable/2021-04-01/dataCollectionEndpoints_API.json +- Microsoft.Insights/stable/2021-04-01/dataCollectionRuleAssociations_API.json +- Microsoft.Insights/stable/2021-04-01/dataCollectionRules_API.json ``` ### Tag: package-2021-05-01-preview-only @@ -692,6 +723,58 @@ directive: reason: 'Updating the error response to the new format would be a breaking change.' ``` +``` yaml $(go) || $(csharp) || $(validation) || $(typescript) +directive: +- from: activityLogAlerts_API.json + where: $.definitions + transform: delete $["Resource"] + reason: Missing kind, etag; Generation will take the definition from scheduledQueryRule_API.json which includes kind & etag +``` + +``` yaml !$(python) && !$(go) && !$(java) +directive: +- from: activityLogAlerts_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: guestDiagnosticSettings_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: guestDiagnosticSettingsAssociation_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: privateLinkScopes_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: scheduledQueryRule_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: autoscale_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: alertRules_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: alertRulesIncidents_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: actionGroups_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +- from: metricAlert_API.json + where: $.parameters + transform: delete $["ResourceGroupNameParameter"] + reason: ResourceGroupNameParameter is taken from v2/types.json +``` + ### Tag: profile-hybrid-2019-03-01 These settings apply only when `--tag=profile-hybrid-2019-03-01` is specified on the command line. diff --git a/specification/monitor/resource-manager/readme.python.md b/specification/monitor/resource-manager/readme.python.md index be79843a67d2..854e9ba6d3ce 100644 --- a/specification/monitor/resource-manager/readme.python.md +++ b/specification/monitor/resource-manager/readme.python.md @@ -30,6 +30,7 @@ Generate all API versions currently shipped for this package clear-output-folder: true batch: - tag: package-2021-05-01-preview-only + - tag: package-2021-04-only - tag: package-2020-10-only - tag: package-2020-05-preview-only - tag: package-2020-01-01-preview-only @@ -70,6 +71,16 @@ namespace: $(python-base-namespace).v2021_05_01_preview output-folder: $(python-sdks-folder)/$(python-base-folder)/v2021_05_01_preview ``` +### Tag: package-2021-04-only and python + +These settings apply only when `--tag=package-2021-04-only --python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +``` yaml $(tag) == 'package-2021-04-only' +namespace: $(python-base-namespace).v2021_04_01 +output-folder: $(python-sdks-folder)/$(python-base-folder)/v2021_04_01 +``` + ### Tag: package-2020-10-only and python These settings apply only when `--tag=package-2020-10-only --python` is specified on the command line.