Skip to content

Commit 0490165

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into alertmanagement
2 parents 3a14897 + e63a68a commit 0490165

File tree

243 files changed

+10208
-7969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+10208
-7969
lines changed

scripts/multiapi.ts

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import * as yaml from "js-yaml"
1111
type Code = {
1212
readonly "input-file"?: ReadonlyArray<string>|string
1313
}
14-
const magic = `yaml $(tag) == 'all-api-versions' /* autogenerated */`;
15-
const header = `## Multi-API/Profile support for AutoRest v3 generators`;
16-
14+
const yamlBegin = `yaml $(tag) == 'all-api-versions' /* autogenerated */`;
1715

1816
const main = async (specificationDir: string, profilesDir: string) => {
1917
try {
@@ -29,77 +27,52 @@ const main = async (specificationDir: string, profilesDir: string) => {
2927
if (
3028
c.type === "code_block" &&
3129
c.info !== null &&
32-
(c.info.startsWith("yaml") && !c.info.startsWith(magic)) &&
30+
(c.info.startsWith("yaml") && !c.info.startsWith(yamlBegin)) &&
3331
c.literal !== null
3432
) {
3533
const DOC = (yaml.load(c.literal) as Code);
3634
if (DOC ) {
3735
const y = DOC['input-file']
3836
if (typeof y === "string") {
39-
set.add(`$(this-folder)/${y}`)
37+
set.add(y)
4038
} else if (it.isArray(y)) {
4139
for (const i of y) {
42-
set.add(`$(this-folder)/${i}`)
40+
set.add(i)
4341
}
4442
}
4543
}
4644

4745
}
4846
}
49-
if( !content.includes(header) ) {
50-
// add the header to the content
51-
content = content + `
52-
${header}
53-
54-
AutoRest V3 generators require the use of \`--tag=all-api-versions\` to select api files.
55-
56-
This block is updated by an automatic script. Edits may be lost!
57-
58-
\`\`\` ${magic}
59-
\`\`\`
47+
const block =
48+
`## AzureResourceSchema
6049
61-
If there are files that should not be in the \`all-api-versions\` set,
62-
uncomment the \`exclude-file\` section below and add the file paths.
50+
These settings apply only when \`--azureresourceschema\` is specified on the command line.
6351
64-
\`\`\` yaml $(tag) == 'all-api-versions'
65-
#exclude-file:
66-
# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json
67-
\`\`\`
52+
### AzureResourceSchema multi-api
6853
69-
`
70-
}
71-
// update the autogenrated block with the new content.
72-
/* const readMeMulti = cm.createNode(
73-
"document",
74-
cm.createNode(
75-
"heading",
76-
cm.createText("# Multi-API/Profile support for AutoRest v3 generators")
77-
),
78-
cm.createCodeBlock(
79-
magic,
80-
yaml.dump({ "input-file": it.toArray(set), "require": `$(this-folder)/${path.relative(f.dir, profilesDir).replace(/\\/g, '/')}/readme.md` }, { lineWidth: 1000 })
81-
)
82-
)
83-
const block1 =cm.markDownExToString({ markDown: cm.createCodeBlock(
84-
magic,
85-
yaml.dump({
86-
"input-file": it.toArray(set),
87-
"require": `$(this-folder)/${path.relative(f.dir, profilesDir).replace(/\\/g, '/')}/readme.md` }, { lineWidth: 1000 })
88-
)});*/
89-
const block =
90-
`\`\`\` ${magic}
54+
\`\`\` yaml $(azureresourceschema) && $(multiapi)
9155
# include the azure profile definitions from the standard location
92-
require: $(this-folder)/${path.relative(f.dir, profilesDir).replace(/\\/g, '/')}/readme.md
56+
require: ${path.relative(f.dir, profilesDir).replace(/\\/g, '/')}/readme.md
57+
58+
output-folder: $(azureresourceschema-folder)/schemas
9359
9460
# all the input files across all versions
9561
${yaml.dump({ 'input-file': it.toArray(set) },{ lineWidth: 1000 } )}
9662
\`\`\``
97-
content = content.replace( /``` yaml \$\(tag\) == 'all-api-versions' \/\* autogenerated \*\/[\S\s]*?```/g, block)
63+
content = content.replace( /``` yaml \$\(tag\) == 'all-api-versions' \/\* autogenerated \*\/[\S\s]*?```/g, '')
64+
content = content.replace( /``` yaml \$\(tag\) == 'all-api-versions'[\S\s]*?```/g, '')
65+
content = content.replace( /## Multi-API\/Profile support for AutoRest v3 generators[\S\s]*/g, '')
9866

9967
if(original_content !== content ){
10068
console.log(`Updating: ${file}`);
10169
fs.writeFile(path.join(f.dir, "readme.md"), content)
10270
}
71+
72+
if (f.dir.endsWith('/resource-manager')) {
73+
console.log(`Rewriting: ${f.dir}/readme.azureresourceschema.md`);
74+
fs.writeFile(path.join(f.dir, "readme.azureresourceschema.md"), block);
75+
}
10376

10477
}
10578
}

specification/EnterpriseKnowledgeGraph/resource-manager/readme.azureresourceschema.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ These settings apply only when `--azureresourceschema` is specified on the comma
55
### AzureResourceSchema multi-api
66

77
``` yaml $(azureresourceschema) && $(multiapi)
8-
batch:
9-
- tag: package-2018-12-03
10-
```
8+
# include the azure profile definitions from the standard location
9+
require: ../../../profiles/readme.md
1110

12-
### Tag: package-2018-12-03 and azureresourceschema
13-
14-
These settings apply only when `--tag=package-2018-12-03 --azureresourceschema` is specified on the command line.
15-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
16-
17-
``` yaml $(tag) == 'package-2018-12-03' && $(azureresourceschema)
1811
output-folder: $(azureresourceschema-folder)/schemas
19-
```
2012

13+
# all the input files across all versions
14+
input-file:
15+
- Microsoft.EnterpriseKnowledgeGraph/preview/2018-12-03/EnterpriseKnowledgeGraphSwagger.json
16+
17+
```

specification/addons/resource-manager/readme.azureresourceschema.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,14 @@ These settings apply only when `--azureresourceschema` is specified on the comma
55
### AzureResourceSchema multi-api
66

77
``` yaml $(azureresourceschema) && $(multiapi)
8-
batch:
9-
- tag: package-2018-03
10-
- tag: package-2017-05
11-
```
8+
# include the azure profile definitions from the standard location
9+
require: ../../../profiles/readme.md
1210

13-
### Tag: package-2018-03 and azureresourceschema
14-
15-
These settings apply only when `--tag=package-2018-03 --azureresourceschema` is specified on the command line.
16-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
17-
18-
``` yaml $(tag) == 'package-2018-03' && $(azureresourceschema)
1911
output-folder: $(azureresourceschema-folder)/schemas
20-
```
21-
22-
### Tag: package-2017-05 and azureresourceschema
2312

24-
These settings apply only when `--tag=package-2017-05 --azureresourceschema` is specified on the command line.
25-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
26-
27-
``` yaml $(tag) == 'package-2017-05' && $(azureresourceschema)
28-
output-folder: $(azureresourceschema-folder)/schemas
29-
```
13+
# all the input files across all versions
14+
input-file:
15+
- Microsoft.Addons/preview/2018-03-01/addons-swagger.json
16+
- Microsoft.Addons/preview/2017-05-15/Addons.json
3017

18+
```

specification/adhybridhealthservice/resource-manager/readme.azureresourceschema.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ These settings apply only when `--azureresourceschema` is specified on the comma
55
### AzureResourceSchema multi-api
66

77
``` yaml $(azureresourceschema) && $(multiapi)
8-
batch:
9-
- tag: package-2014-01
10-
```
8+
# include the azure profile definitions from the standard location
9+
require: ../../../profiles/readme.md
1110

12-
### Tag: package-2014-01 and azureresourceschema
13-
14-
These settings apply only when `--tag=package-2014-01 --azureresourceschema` is specified on the command line.
15-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
16-
17-
``` yaml $(tag) == 'package-2014-01' && $(azureresourceschema)
1811
output-folder: $(azureresourceschema-folder)/schemas
19-
```
2012

13+
# all the input files across all versions
14+
input-file:
15+
- Microsoft.ADHybridHealthService\stable\2014-01-01\ADHybridHealthService.json
16+
17+
```

specification/advisor/resource-manager/readme.azureresourceschema.md

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,17 @@ These settings apply only when `--azureresourceschema` is specified on the comma
55
### AzureResourceSchema multi-api
66

77
``` yaml $(azureresourceschema) && $(multiapi)
8-
batch:
9-
- tag: package-2020-07-preview
10-
- tag: package-2020-01
11-
- tag: package-2017-04
12-
- tag: package-2017-03
13-
- tag: package-2016-07-preview
14-
```
8+
# include the azure profile definitions from the standard location
9+
require: ../../../profiles/readme.md
1510

16-
### Tag: package-2020-07-preview and azureresourceschema
17-
18-
These settings apply only when `--tag=package-2020-07-preview --azureresourceschema` is specified on the command line.
19-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
20-
21-
``` yaml $(tag) == 'package-2020-07-preview' && $(azureresourceschema)
2211
output-folder: $(azureresourceschema-folder)/schemas
23-
```
24-
25-
### Tag: package-2020-01 and azureresourceschema
2612

27-
These settings apply only when `--tag=package-2020-01 --azureresourceschema` is specified on the command line.
28-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
29-
30-
``` yaml $(tag) == 'package-2020-01' && $(azureresourceschema)
31-
output-folder: $(azureresourceschema-folder)/schemas
32-
```
33-
34-
### Tag: package-2017-04 and azureresourceschema
35-
36-
These settings apply only when `--tag=package-2017-04 --azureresourceschema` is specified on the command line.
37-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
38-
39-
``` yaml $(tag) == 'package-2017-04' && $(azureresourceschema)
40-
output-folder: $(azureresourceschema-folder)/schemas
41-
```
42-
43-
### Tag: package-2017-03 and azureresourceschema
44-
45-
These settings apply only when `--tag=package-2017-03 --azureresourceschema` is specified on the command line.
46-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
47-
48-
``` yaml $(tag) == 'package-2017-03' && $(azureresourceschema)
49-
output-folder: $(azureresourceschema-folder)/schemas
50-
```
51-
52-
### Tag: package-2016-07-preview and azureresourceschema
53-
54-
These settings apply only when `--tag=package-2016-07-preview --azureresourceschema` is specified on the command line.
55-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
56-
57-
``` yaml $(tag) == 'package-2016-07-preview' && $(azureresourceschema)
58-
output-folder: $(azureresourceschema-folder)/schemas
59-
```
13+
# all the input files across all versions
14+
input-file:
15+
- Microsoft.Advisor/preview/2020-07-01-preview/advisor.json
16+
- Microsoft.Advisor/stable/2020-01-01/advisor.json
17+
- Microsoft.Advisor/stable/2017-04-19/advisor.json
18+
- Microsoft.Advisor/stable/2017-03-31/advisor.json
19+
- Microsoft.Advisor/preview/2016-07-12-preview/advisor.json
6020

21+
```

specification/alertsmanagement/resource-manager/readme.azureresourceschema.md

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,20 @@ These settings apply only when `--azureresourceschema` is specified on the comma
55
### AzureResourceSchema multi-api
66

77
``` yaml $(azureresourceschema) && $(multiapi)
8-
batch:
9-
- tag: package-2019-06-preview
10-
- tag: package-2019-06
11-
- tag: package-2019-03
12-
- tag: package-preview-2019-05
13-
- tag: package-2018-05
14-
- tag: package-2018-05-preview
15-
```
8+
# include the azure profile definitions from the standard location
9+
require: ../../../profiles/readme.md
1610

17-
### Tag: package-2019-06-preview and azureresourceschema
18-
19-
These settings apply only when `--tag=package-2019-06-preview --azureresourceschema` is specified on the command line.
20-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
21-
22-
``` yaml $(tag) == 'package-2019-06-preview' && $(azureresourceschema)
23-
output-folder: $(azureresourceschema-folder)/schemas
24-
```
25-
26-
### Tag: package-2019-06 and azureresourceschema
27-
28-
These settings apply only when `--tag=package-2019-06 --azureresourceschema` is specified on the command line.
29-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
30-
31-
``` yaml $(tag) == 'package-2019-06' && $(azureresourceschema)
32-
output-folder: $(azureresourceschema-folder)/schemas
33-
```
34-
35-
### Tag: package-2019-03 and azureresourceschema
36-
37-
These settings apply only when `--tag=package-2019-03 --azureresourceschema` is specified on the command line.
38-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
39-
40-
``` yaml $(tag) == 'package-2019-03' && $(azureresourceschema)
41-
output-folder: $(azureresourceschema-folder)/schemas
42-
```
43-
44-
### Tag: package-preview-2019-05 and azureresourceschema
45-
46-
These settings apply only when `--tag=package-preview-2019-05 --azureresourceschema` is specified on the command line.
47-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
48-
49-
``` yaml $(tag) == 'package-preview-2019-05' && $(azureresourceschema)
50-
output-folder: $(azureresourceschema-folder)/schemas
51-
```
52-
53-
### Tag: package-2018-05 and azureresourceschema
54-
55-
These settings apply only when `--tag=package-2018-05 --azureresourceschema` is specified on the command line.
56-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
57-
58-
``` yaml $(tag) == 'package-2018-05' && $(azureresourceschema)
59-
output-folder: $(azureresourceschema-folder)/schemas
60-
```
61-
62-
### Tag: package-2018-05-preview and azureresourceschema
63-
64-
These settings apply only when `--tag=package-2018-05-preview --azureresourceschema` is specified on the command line.
65-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
66-
67-
``` yaml $(tag) == 'package-2018-05-preview' && $(azureresourceschema)
6811
output-folder: $(azureresourceschema-folder)/schemas
69-
```
7012

13+
# all the input files across all versions
14+
input-file:
15+
- Microsoft.AlertsManagement/preview/2019-05-05-preview/ActionRules.json
16+
- Microsoft.AlertsManagement/preview/2019-05-05-preview/AlertsManagement.json
17+
- Microsoft.AlertsManagement/preview/2019-05-05-preview/SmartGroups.json
18+
- Microsoft.AlertsManagement/stable/2019-06-01/SmartDetectorAlertRulesApi.json
19+
- Microsoft.AlertsManagement/stable/2019-03-01/AlertsManagement.json
20+
- Microsoft.AlertsManagement/stable/2019-03-01/SmartDetectorAlertRulesApi.json
21+
- Microsoft.AlertsManagement/stable/2018-05-05/AlertsManagement.json
22+
- Microsoft.AlertsManagement/preview/2018-05-05-preview/AlertsManagement.json
23+
24+
```

specification/analysisservices/resource-manager/readme.azureresourceschema.md

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,16 @@ These settings apply only when `--azureresourceschema` is specified on the comma
55
### AzureResourceSchema multi-api
66

77
``` yaml $(azureresourceschema) && $(multiapi)
8-
batch:
9-
- tag: package-2017-08
10-
- tag: package-2017-07
11-
- tag: package-2016-05
12-
```
8+
# include the azure profile definitions from the standard location
9+
require: ../../../profiles/readme.md
1310

14-
### Tag: package-2017-08 and azureresourceschema
15-
16-
These settings apply only when `--tag=package-2017-08 --azureresourceschema` is specified on the command line.
17-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
18-
19-
``` yaml $(tag) == 'package-2017-08' && $(azureresourceschema)
2011
output-folder: $(azureresourceschema-folder)/schemas
21-
```
22-
23-
### Tag: package-2017-07 and azureresourceschema
2412

25-
These settings apply only when `--tag=package-2017-07 --azureresourceschema` is specified on the command line.
26-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
27-
28-
``` yaml $(tag) == 'package-2017-07' && $(azureresourceschema)
29-
output-folder: $(azureresourceschema-folder)/schemas
30-
```
31-
32-
### Tag: package-2016-05 and azureresourceschema
33-
34-
These settings apply only when `--tag=package-2016-05 --azureresourceschema` is specified on the command line.
35-
Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.
36-
37-
``` yaml $(tag) == 'package-2016-05' && $(azureresourceschema)
38-
output-folder: $(azureresourceschema-folder)/schemas
39-
```
13+
# all the input files across all versions
14+
input-file:
15+
- Microsoft.AnalysisServices/stable/2017-08-01/analysisservices.json
16+
- Microsoft.AnalysisServices/preview/2017-08-01-beta/analysisservices.json
17+
- Microsoft.AnalysisServices/stable/2017-07-14/analysisservices.json
18+
- Microsoft.AnalysisServices/stable/2016-05-16/analysisservices.json
4019

20+
```

0 commit comments

Comments
 (0)