Skip to content

Commit 5ffa6f9

Browse files
authored
Update Azure Monitor readme.{go/python}.md with the latest specs (Azure#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
1 parent 9f25bad commit 5ffa6f9

File tree

7 files changed

+183
-19
lines changed

7 files changed

+183
-19
lines changed

specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionEndpoints_API.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"default": {
5151
"description": "Error",
5252
"schema": {
53-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
53+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
5454
}
5555
}
5656
},
@@ -92,7 +92,7 @@
9292
"default": {
9393
"description": "Error",
9494
"schema": {
95-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
95+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
9696
}
9797
}
9898
},
@@ -140,7 +140,7 @@
140140
"default": {
141141
"description": "Error",
142142
"schema": {
143-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
143+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
144144
}
145145
}
146146
},
@@ -200,7 +200,7 @@
200200
"default": {
201201
"description": "Error",
202202
"schema": {
203-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
203+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
204204
}
205205
}
206206
},
@@ -254,7 +254,7 @@
254254
"default": {
255255
"description": "Error",
256256
"schema": {
257-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
257+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
258258
}
259259
}
260260
},
@@ -297,7 +297,7 @@
297297
"default": {
298298
"description": "Error",
299299
"schema": {
300-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
300+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
301301
}
302302
}
303303
},

specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRuleAssociations_API.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"default": {
4848
"description": "Error",
4949
"schema": {
50-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
50+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
5151
}
5252
}
5353
},
@@ -95,7 +95,7 @@
9595
"default": {
9696
"description": "Error",
9797
"schema": {
98-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
98+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
9999
}
100100
}
101101
},
@@ -140,7 +140,7 @@
140140
"default": {
141141
"description": "Error",
142142
"schema": {
143-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
143+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
144144
}
145145
}
146146
},
@@ -197,7 +197,7 @@
197197
"default": {
198198
"description": "Error",
199199
"schema": {
200-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
200+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
201201
}
202202
}
203203
},
@@ -237,7 +237,7 @@
237237
"default": {
238238
"description": "Error",
239239
"schema": {
240-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
240+
"$ref": "./dataCollectionRules_API.json#/definitions/ErrorResponseCommonV2"
241241
}
242242
}
243243
},

specification/monitor/resource-manager/Microsoft.Insights/stable/2021-04-01/dataCollectionRules_API.json

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"default": {
5151
"description": "Error",
5252
"schema": {
53-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
53+
"$ref": "#/definitions/ErrorResponseCommonV2"
5454
}
5555
}
5656
},
@@ -92,7 +92,7 @@
9292
"default": {
9393
"description": "Error",
9494
"schema": {
95-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
95+
"$ref": "#/definitions/ErrorResponseCommonV2"
9696
}
9797
}
9898
},
@@ -140,7 +140,7 @@
140140
"default": {
141141
"description": "Error",
142142
"schema": {
143-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
143+
"$ref": "#/definitions/ErrorResponseCommonV2"
144144
}
145145
}
146146
},
@@ -200,7 +200,7 @@
200200
"default": {
201201
"description": "Error",
202202
"schema": {
203-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
203+
"$ref": "#/definitions/ErrorResponseCommonV2"
204204
}
205205
}
206206
},
@@ -254,7 +254,7 @@
254254
"default": {
255255
"description": "Error",
256256
"schema": {
257-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
257+
"$ref": "#/definitions/ErrorResponseCommonV2"
258258
}
259259
}
260260
},
@@ -297,7 +297,7 @@
297297
"default": {
298298
"description": "Error",
299299
"schema": {
300-
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
300+
"$ref": "#/definitions/ErrorResponseCommonV2"
301301
}
302302
}
303303
},
@@ -821,6 +821,17 @@
821821
}
822822
}
823823
}
824+
},
825+
"ErrorResponseCommonV2": {
826+
"title": "Error response",
827+
"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.).",
828+
"type": "object",
829+
"properties": {
830+
"error": {
831+
"description": "The error object.",
832+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorDetail"
833+
}
834+
}
824835
}
825836
},
826837
"parameters": {

specification/monitor/resource-manager/readme.csharp.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,12 @@ output-folder: $(csharp-sdks-folder)/$(csharp-profile)/Monitor/Management.Monito
4444
4545
batch:
4646
- tag: profile-hybrid-2020-09-01
47-
```
47+
```
48+
49+
## Local Development
50+
51+
### Auto Generation
52+
- Fork https://github.com/Azure/azure-rest-api-specs, clone it (asumming at C:\Repos)
53+
- Fork https://github.com/Azure/azure-sdk-for-net, clone it (asumming at C:\Repos)
54+
- Make changes
55+
- autorest --version=V2 --csharp --reflect-api-versions --license-header=MICROSOFT_MIT_NO_VERSION [email protected]/[email protected] --csharp-sdks-folder=C:\Repos\azure-sdk-for-net\sdk C:\Repos\azure-rest-api-specs\specification\monitor\resource-manager\readme.md --debug

specification/monitor/resource-manager/readme.go.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ batch:
2121
- tag: package-2019-06
2222
- tag: package-2019-11
2323
- tag: package-2020-10-only
24+
- tag: package-2021-04
2425
```
2526
2627
### Tag: package-2017-09 and go
@@ -94,3 +95,53 @@ Please also specify `--go-sdk-folder=<path to the root directory of your azure-s
9495
``` yaml $(tag) == 'package-2020-10-only' && $(go)
9596
output-folder: $(go-sdk-folder)/services/monitor/mgmt/2020-10-01/$(namespace)
9697
```
98+
99+
### Tag: package-2021-04 and go
100+
101+
These settings apply only when `--tag=package-2021-04 --go` is specified on the command line.
102+
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.
103+
104+
``` yaml $(tag) == 'package-2021-04' && $(go)
105+
output-folder: $(go-sdk-folder)/services/preview/monitor/mgmt/2021-04-01-preview/$(namespace)
106+
directive:
107+
- from: activityLogAlerts_API.json
108+
where: $.parameters
109+
transform: delete $["ResourceGroupNameParameter"]
110+
reason: ResourceGroupNameParameter is taken from v2/types.json
111+
- from: guestDiagnosticSettings_API.json
112+
where: $.parameters
113+
transform: delete $["ResourceGroupNameParameter"]
114+
reason: ResourceGroupNameParameter is taken from v2/types.json
115+
- from: guestDiagnosticSettingsAssociation_API.json
116+
where: $.parameters
117+
transform: delete $["ResourceGroupNameParameter"]
118+
reason: ResourceGroupNameParameter is taken from v2/types.json
119+
- from: privateLinkScopes_API.json
120+
where: $.parameters
121+
transform: delete $["ResourceGroupNameParameter"]
122+
reason: ResourceGroupNameParameter is taken from v2/types.json
123+
- from: scheduledQueryRule_API.json
124+
where: $.parameters
125+
transform: delete $["ResourceGroupNameParameter"]
126+
reason: ResourceGroupNameParameter is taken from v2/types.json
127+
- from: autoscale_API.json
128+
where: $.parameters
129+
transform: delete $["ResourceGroupNameParameter"]
130+
reason: ResourceGroupNameParameter is taken from v2/types.json
131+
- from: alertRules_API.json
132+
where: $.parameters
133+
transform: delete $["ResourceGroupNameParameter"]
134+
reason: ResourceGroupNameParameter is taken from v2/types.json
135+
- from: alertRulesIncidents_API.json
136+
where: $.parameters
137+
transform: delete $["ResourceGroupNameParameter"]
138+
reason: ResourceGroupNameParameter is taken from v2/types.json
139+
- from: actionGroups_API.json
140+
where: $.parameters
141+
transform: delete $["ResourceGroupNameParameter"]
142+
reason: ResourceGroupNameParameter is taken from v2/types.json
143+
- from: metricAlert_API.json
144+
where: $.parameters
145+
transform: delete $["ResourceGroupNameParameter"]
146+
reason: ResourceGroupNameParameter is taken from v2/types.json
147+
```

specification/monitor/resource-manager/readme.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,38 @@ title: MonitorManagementClient
4040
``` yaml
4141
description: Monitor Management Client
4242
openapi-type: arm
43-
tag: package-2020-03
43+
tag: package-2021-04
44+
```
45+
46+
### Tag: package-2021-04
47+
48+
These settings apply only when `--tag=package-2021-04` is specified on the command line.
49+
50+
``` yaml $(tag) == 'package-2021-04'
51+
input-file:
52+
- Microsoft.Insights/stable/2015-04-01/autoscale_API.json
53+
- Microsoft.Insights/stable/2015-04-01/operations_API.json
54+
- Microsoft.Insights/stable/2016-03-01/alertRulesIncidents_API.json
55+
- Microsoft.Insights/stable/2016-03-01/alertRules_API.json
56+
- Microsoft.Insights/stable/2016-03-01/logProfiles_API.json
57+
- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettings_API.json
58+
- Microsoft.Insights/preview/2017-05-01-preview/diagnosticsSettingsCategories_API.json
59+
- Microsoft.Insights/stable/2019-06-01/actionGroups_API.json
60+
- Microsoft.Insights/stable/2015-04-01/activityLogs_API.json
61+
- Microsoft.Insights/stable/2015-04-01/eventCategories_API.json
62+
- Microsoft.Insights/stable/2015-04-01/tenantActivityLogs_API.json
63+
- Microsoft.Insights/stable/2018-01-01/metricDefinitions_API.json
64+
- Microsoft.Insights/stable/2018-01-01/metrics_API.json
65+
- Microsoft.Insights/stable/2019-03-01/metricBaselines_API.json
66+
- Microsoft.Insights/stable/2018-03-01/metricAlert_API.json
67+
- Microsoft.Insights/stable/2018-04-16/scheduledQueryRule_API.json
68+
- Microsoft.Insights/preview/2017-12-01-preview/metricNamespaces_API.json
69+
- Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json
70+
- Microsoft.Insights/preview/2019-10-17-preview/privateLinkScopes_API.json
71+
- Microsoft.Insights/stable/2017-04-01/activityLogAlerts_API.json
72+
- Microsoft.Insights/stable/2021-04-01/dataCollectionEndpoints_API.json
73+
- Microsoft.Insights/stable/2021-04-01/dataCollectionRuleAssociations_API.json
74+
- Microsoft.Insights/stable/2021-04-01/dataCollectionRules_API.json
4475
```
4576
### Tag: package-2021-05-01-preview-only
4677

@@ -692,6 +723,58 @@ directive:
692723
reason: 'Updating the error response to the new format would be a breaking change.'
693724
```
694725

726+
``` yaml $(go) || $(csharp) || $(validation) || $(typescript)
727+
directive:
728+
- from: activityLogAlerts_API.json
729+
where: $.definitions
730+
transform: delete $["Resource"]
731+
reason: Missing kind, etag; Generation will take the definition from scheduledQueryRule_API.json which includes kind & etag
732+
```
733+
734+
``` yaml !$(python) && !$(go) && !$(java)
735+
directive:
736+
- from: activityLogAlerts_API.json
737+
where: $.parameters
738+
transform: delete $["ResourceGroupNameParameter"]
739+
reason: ResourceGroupNameParameter is taken from v2/types.json
740+
- from: guestDiagnosticSettings_API.json
741+
where: $.parameters
742+
transform: delete $["ResourceGroupNameParameter"]
743+
reason: ResourceGroupNameParameter is taken from v2/types.json
744+
- from: guestDiagnosticSettingsAssociation_API.json
745+
where: $.parameters
746+
transform: delete $["ResourceGroupNameParameter"]
747+
reason: ResourceGroupNameParameter is taken from v2/types.json
748+
- from: privateLinkScopes_API.json
749+
where: $.parameters
750+
transform: delete $["ResourceGroupNameParameter"]
751+
reason: ResourceGroupNameParameter is taken from v2/types.json
752+
- from: scheduledQueryRule_API.json
753+
where: $.parameters
754+
transform: delete $["ResourceGroupNameParameter"]
755+
reason: ResourceGroupNameParameter is taken from v2/types.json
756+
- from: autoscale_API.json
757+
where: $.parameters
758+
transform: delete $["ResourceGroupNameParameter"]
759+
reason: ResourceGroupNameParameter is taken from v2/types.json
760+
- from: alertRules_API.json
761+
where: $.parameters
762+
transform: delete $["ResourceGroupNameParameter"]
763+
reason: ResourceGroupNameParameter is taken from v2/types.json
764+
- from: alertRulesIncidents_API.json
765+
where: $.parameters
766+
transform: delete $["ResourceGroupNameParameter"]
767+
reason: ResourceGroupNameParameter is taken from v2/types.json
768+
- from: actionGroups_API.json
769+
where: $.parameters
770+
transform: delete $["ResourceGroupNameParameter"]
771+
reason: ResourceGroupNameParameter is taken from v2/types.json
772+
- from: metricAlert_API.json
773+
where: $.parameters
774+
transform: delete $["ResourceGroupNameParameter"]
775+
reason: ResourceGroupNameParameter is taken from v2/types.json
776+
```
777+
695778
### Tag: profile-hybrid-2019-03-01
696779

697780
These settings apply only when `--tag=profile-hybrid-2019-03-01` is specified on the command line.

specification/monitor/resource-manager/readme.python.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Generate all API versions currently shipped for this package
3030
clear-output-folder: true
3131
batch:
3232
- tag: package-2021-05-01-preview-only
33+
- tag: package-2021-04-only
3334
- tag: package-2020-10-only
3435
- tag: package-2020-05-preview-only
3536
- tag: package-2020-01-01-preview-only
@@ -70,6 +71,16 @@ namespace: $(python-base-namespace).v2021_05_01_preview
7071
output-folder: $(python-sdks-folder)/$(python-base-folder)/v2021_05_01_preview
7172
```
7273

74+
### Tag: package-2021-04-only and python
75+
76+
These settings apply only when `--tag=package-2021-04-only --python` is specified on the command line.
77+
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
78+
79+
``` yaml $(tag) == 'package-2021-04-only'
80+
namespace: $(python-base-namespace).v2021_04_01
81+
output-folder: $(python-sdks-folder)/$(python-base-folder)/v2021_04_01
82+
```
83+
7384
### Tag: package-2020-10-only and python
7485

7586
These settings apply only when `--tag=package-2020-10-only --python` is specified on the command line.

0 commit comments

Comments
 (0)