Skip to content

Commit dc9eeeb

Browse files
author
Arsene Muhire
committed
Add DiskRP resource name patterns
1 parent 483f0fc commit dc9eeeb

6 files changed

Lines changed: 210 additions & 121 deletions

File tree

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/DiskAccess.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ model DiskAccess
2020
Resource = DiskAccess,
2121
KeyName = "diskAccessName",
2222
SegmentName = "diskAccesses",
23-
NamePattern = ""
23+
NamePattern = "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2424
>;
2525

2626
/**

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/DiskEncryptionSet.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ model DiskEncryptionSet
2020
Resource = DiskEncryptionSet,
2121
KeyName = "diskEncryptionSetName",
2222
SegmentName = "diskEncryptionSets",
23-
NamePattern = ""
23+
NamePattern = "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2424
>;
2525

2626
/**

specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/DiskRestorePoint.tsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ model DiskRestorePoint
2020
Resource = DiskRestorePoint,
2121
KeyName = "diskRestorePointName",
2222
SegmentName = "diskRestorePoints",
23-
NamePattern = ""
23+
NamePattern = "^[^_\\W][\\w-._]{0,259}(?<![-.])$"
2424
>;
2525
}
2626

@@ -54,7 +54,7 @@ interface DiskRestorePointsOps
5454
DiskRestorePoint,
5555
SegmentName = "diskRestorePoints",
5656
KeyName = "diskRestorePointName",
57-
NamePattern = ""
57+
NamePattern = "^[^_\\W][\\w-._]{0,259}(?<![-.])$"
5858
>,
5959
}>,
6060
CloudError

specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2024-03-02/DiskRP.json

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@
276276
"in": "path",
277277
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
278278
"required": true,
279-
"type": "string"
279+
"type": "string",
280+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
280281
}
281282
],
282283
"responses": {
@@ -323,7 +324,8 @@
323324
"in": "path",
324325
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
325326
"required": true,
326-
"type": "string"
327+
"type": "string",
328+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
327329
},
328330
{
329331
"name": "diskAccess",
@@ -398,7 +400,8 @@
398400
"in": "path",
399401
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
400402
"required": true,
401-
"type": "string"
403+
"type": "string",
404+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
402405
},
403406
{
404407
"name": "diskAccess",
@@ -473,7 +476,8 @@
473476
"in": "path",
474477
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
475478
"required": true,
476-
"type": "string"
479+
"type": "string",
480+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
477481
}
478482
],
479483
"responses": {
@@ -537,7 +541,8 @@
537541
"in": "path",
538542
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
539543
"required": true,
540-
"type": "string"
544+
"type": "string",
545+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
541546
}
542547
],
543548
"responses": {
@@ -586,7 +591,8 @@
586591
"in": "path",
587592
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
588593
"required": true,
589-
"type": "string"
594+
"type": "string",
595+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
590596
},
591597
{
592598
"name": "privateEndpointConnectionName",
@@ -637,7 +643,8 @@
637643
"in": "path",
638644
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
639645
"required": true,
640-
"type": "string"
646+
"type": "string",
647+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
641648
},
642649
{
643650
"name": "privateEndpointConnectionName",
@@ -719,7 +726,8 @@
719726
"in": "path",
720727
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
721728
"required": true,
722-
"type": "string"
729+
"type": "string",
730+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
723731
},
724732
{
725733
"name": "privateEndpointConnectionName",
@@ -790,7 +798,8 @@
790798
"in": "path",
791799
"description": "The name of the disk access resource that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
792800
"required": true,
793-
"type": "string"
801+
"type": "string",
802+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
794803
}
795804
],
796805
"responses": {
@@ -878,7 +887,8 @@
878887
"in": "path",
879888
"description": "The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
880889
"required": true,
881-
"type": "string"
890+
"type": "string",
891+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
882892
}
883893
],
884894
"responses": {
@@ -925,7 +935,8 @@
925935
"in": "path",
926936
"description": "The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
927937
"required": true,
928-
"type": "string"
938+
"type": "string",
939+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
929940
},
930941
{
931942
"name": "diskEncryptionSet",
@@ -1006,7 +1017,8 @@
10061017
"in": "path",
10071018
"description": "The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
10081019
"required": true,
1009-
"type": "string"
1020+
"type": "string",
1021+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
10101022
},
10111023
{
10121024
"name": "diskEncryptionSet",
@@ -1087,7 +1099,8 @@
10871099
"in": "path",
10881100
"description": "The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
10891101
"required": true,
1090-
"type": "string"
1102+
"type": "string",
1103+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
10911104
}
10921105
],
10931106
"responses": {
@@ -1151,7 +1164,8 @@
11511164
"in": "path",
11521165
"description": "The name of the disk encryption set that is being created. The name can't be changed after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
11531166
"required": true,
1154-
"type": "string"
1167+
"type": "string",
1168+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
11551169
}
11561170
],
11571171
"responses": {
@@ -1242,7 +1256,8 @@
12421256
"in": "path",
12431257
"description": "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
12441258
"required": true,
1245-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
1259+
"type": "string",
1260+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
12461261
}
12471262
],
12481263
"responses": {
@@ -1286,7 +1301,8 @@
12861301
"in": "path",
12871302
"description": "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
12881303
"required": true,
1289-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
1304+
"type": "string",
1305+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
12901306
},
12911307
{
12921308
"name": "disk",
@@ -1433,7 +1449,8 @@
14331449
"in": "path",
14341450
"description": "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
14351451
"required": true,
1436-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
1452+
"type": "string",
1453+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
14371454
},
14381455
{
14391456
"name": "disk",
@@ -1535,7 +1552,8 @@
15351552
"in": "path",
15361553
"description": "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
15371554
"required": true,
1538-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
1555+
"type": "string",
1556+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
15391557
}
15401558
],
15411559
"responses": {
@@ -1599,7 +1617,8 @@
15991617
"in": "path",
16001618
"description": "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
16011619
"required": true,
1602-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
1620+
"type": "string",
1621+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
16031622
},
16041623
{
16051624
"name": "grantAccessData",
@@ -1676,7 +1695,8 @@
16761695
"in": "path",
16771696
"description": "The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters.",
16781697
"required": true,
1679-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
1698+
"type": "string",
1699+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
16801700
}
16811701
],
16821702
"responses": {
@@ -1807,7 +1827,8 @@
18071827
"in": "path",
18081828
"description": "The name of the DiskRestorePoint",
18091829
"required": true,
1810-
"type": "string"
1830+
"type": "string",
1831+
"pattern": "^[^_\\W][\\w-._]{0,259}(?<![-.])$"
18111832
}
18121833
],
18131834
"responses": {
@@ -1870,7 +1891,8 @@
18701891
"in": "path",
18711892
"description": "The name of the DiskRestorePoint",
18721893
"required": true,
1873-
"type": "string"
1894+
"type": "string",
1895+
"pattern": "^[^_\\W][\\w-._]{0,259}(?<![-.])$"
18741896
},
18751897
{
18761898
"name": "grantAccessData",
@@ -1958,7 +1980,8 @@
19581980
"in": "path",
19591981
"description": "The name of the DiskRestorePoint",
19601982
"required": true,
1961-
"type": "string"
1983+
"type": "string",
1984+
"pattern": "^[^_\\W][\\w-._]{0,259}(?<![-.])$"
19621985
}
19631986
],
19641987
"responses": {
@@ -2061,7 +2084,8 @@
20612084
"in": "path",
20622085
"description": "The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The max name length is 80 characters.",
20632086
"required": true,
2064-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2087+
"type": "string",
2088+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
20652089
}
20662090
],
20672091
"responses": {
@@ -2108,7 +2132,8 @@
21082132
"in": "path",
21092133
"description": "The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The max name length is 80 characters.",
21102134
"required": true,
2111-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2135+
"type": "string",
2136+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
21122137
},
21132138
{
21142139
"name": "snapshot",
@@ -2198,7 +2223,8 @@
21982223
"in": "path",
21992224
"description": "The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The max name length is 80 characters.",
22002225
"required": true,
2201-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2226+
"type": "string",
2227+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
22022228
},
22032229
{
22042230
"name": "snapshot",
@@ -2276,7 +2302,8 @@
22762302
"in": "path",
22772303
"description": "The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The max name length is 80 characters.",
22782304
"required": true,
2279-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2305+
"type": "string",
2306+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
22802307
}
22812308
],
22822309
"responses": {
@@ -2340,7 +2367,8 @@
23402367
"in": "path",
23412368
"description": "The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The max name length is 80 characters.",
23422369
"required": true,
2343-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2370+
"type": "string",
2371+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
23442372
},
23452373
{
23462374
"name": "grantAccessData",
@@ -2414,7 +2442,8 @@
24142442
"in": "path",
24152443
"description": "The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The max name length is 80 characters.",
24162444
"required": true,
2417-
"type": "string",`r`n "pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
2445+
"type": "string",
2446+
"pattern": "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
24182447
}
24192448
],
24202449
"responses": {

0 commit comments

Comments
 (0)