Skip to content

Commit

Permalink
Update Azure Monitor readme.{go/python}.md with the latest specs (Azu…
Browse files Browse the repository at this point in the history
…re#14542)

* Update readme.{go/python}.md with the latest specs

* add new tag: package-2021-04

* Update list for package-2021-04

* Fix CSharpGen adding directive and fix refs in DCR

* Moving directive for all SDKs

* prettier changes

* directive only for go & .net

* fixing go output-folder

* directive, remove azure-validator, add typescript

* fixing PR's LintDiff findings

* fixing breaking changes

* fixing go/python directives

* fix go build

* directive go && package-2021-04

* fix go build prev package-2021-04

* fix java build
  • Loading branch information
herreraj-ms authored and Andrew Sager committed Jun 24, 2021
1 parent bdb8739 commit 51f0d7f
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -92,7 +92,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -140,7 +140,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -200,7 +200,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -254,7 +254,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -297,7 +297,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -95,7 +95,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -140,7 +140,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -197,7 +197,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -237,7 +237,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -92,7 +92,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -140,7 +140,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -200,7 +200,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -254,7 +254,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -297,7 +297,7 @@
"default": {
"description": "Error",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
"$ref": "#/definitions/ErrorResponseCommonV2"
}
}
},
Expand Down Expand Up @@ -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": {
Expand Down
10 changes: 9 additions & 1 deletion specification/monitor/resource-manager/readme.csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ output-folder: $(csharp-sdks-folder)/$(csharp-profile)/Monitor/Management.Monito
batch:
- tag: profile-hybrid-2020-09-01
```
```

## 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
51 changes: 51 additions & 0 deletions specification/monitor/resource-manager/readme.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -94,3 +95,53 @@ Please also specify `--go-sdk-folder=<path to the root directory of your azure-s
``` yaml $(tag) == 'package-2020-10-only' && $(go)
output-folder: $(go-sdk-folder)/services/monitor/mgmt/2020-10-01/$(namespace)
```

### Tag: package-2021-04 and go

These settings apply only when `--tag=package-2021-04 --go` is specified on the command line.
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.

``` 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
```
85 changes: 84 additions & 1 deletion specification/monitor/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions specification/monitor/resource-manager/readme.python.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=<path to the root directory of your azure-sdk-for-python clone>`.

``` 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.
Expand Down

0 comments on commit 51f0d7f

Please sign in to comment.