Skip to content

Commit 83cde4f

Browse files
authored
Fix s360 in reservation and scheduled action APIs (#21677)
* Fix s360 in reservation and scheduled action APIs * Fix lint errors * Fix linter error in RI recommendation example * Fix lint errors * Review comment - changed suppression rule name
1 parent 3d2bd90 commit 83cde4f

File tree

5 files changed

+79
-20
lines changed

5 files changed

+79
-20
lines changed

specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/consumption.json

+31-5
Original file line numberDiff line numberDiff line change
@@ -3632,6 +3632,8 @@
36323632
},
36333633
"ModernReservationRecommendationProperties": {
36343634
"description": "The properties of the reservation recommendation.",
3635+
"type": "object",
3636+
"discriminator": "scope",
36353637
"properties": {
36363638
"location": {
36373639
"type": "string",
@@ -3709,8 +3711,7 @@
37093711
},
37103712
"scope": {
37113713
"description": "Shared or single recommendation.",
3712-
"type": "string",
3713-
"readOnly": true
3714+
"type": "string"
37143715
},
37153716
"skuProperties": {
37163717
"description": "List of sku properties",
@@ -3727,14 +3728,39 @@
37273728
"description": "This is the ARM Sku name.",
37283729
"type": "string",
37293730
"readOnly": true
3730-
},
3731+
}
3732+
},
3733+
"required": [
3734+
"scope"
3735+
]
3736+
},
3737+
"ModernSingleScopeReservationRecommendationProperties": {
3738+
"description": "The properties of the modern reservation recommendation for single scope.",
3739+
"type": "object",
3740+
"x-ms-discriminator-value": "Single",
3741+
"properties": {
37313742
"subscriptionId": {
3732-
"description": "Subscription ID",
3743+
"description": "Subscription ID associated with single scoped recommendation.",
37333744
"type": "string",
37343745
"format": "uuid",
37353746
"readOnly": true
37363747
}
3737-
}
3748+
},
3749+
"allOf": [
3750+
{
3751+
"$ref": "#/definitions/ModernReservationRecommendationProperties"
3752+
}
3753+
]
3754+
},
3755+
"ModernSharedScopeReservationRecommendationProperties": {
3756+
"description": "The properties of the modern reservation recommendation for shared scope.",
3757+
"type": "object",
3758+
"x-ms-discriminator-value": "Shared",
3759+
"allOf": [
3760+
{
3761+
"$ref": "#/definitions/ModernReservationRecommendationProperties"
3762+
}
3763+
]
37383764
},
37393765
"ModernReservationTransactionProperties": {
37403766
"description": "The properties of a modern reservation transaction.",

specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingProfile.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"currency": "USD",
1818
"value": 279881.9457795231
1919
},
20-
"firstUsageDate": "2022-08-22T00:00:00",
20+
"firstUsageDate": "2022-08-22T00:00:00Z",
2121
"instanceFlexibilityGroup": "NA",
2222
"instanceFlexibilityRatio": 1,
2323
"location": "westus2",
@@ -52,7 +52,7 @@
5252
"currency": "USD",
5353
"value": 93208.8596802244
5454
},
55-
"firstUsageDate": "2022-08-22T00:00:00",
55+
"firstUsageDate": "2022-08-22T00:00:00Z",
5656
"instanceFlexibilityGroup": "NA",
5757
"instanceFlexibilityRatio": 1,
5858
"location": "westus2",

specification/consumption/resource-manager/readme.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,10 @@ generate-interface: true
439439
directive:
440440
- suppress: R4009
441441
from: consumption.json
442-
reason: SystemData properties does not fit into the consumption RP APIs as they dont really create any actual resources.
442+
reason: SystemData properties does not fit into the consumption RP APIs as they dont really create any actual resources.
443+
- suppress: GuidUsage
444+
from: consumption.json
445+
reason: Usage of Guid in the consumption RP APIs is signed off from the ARM team.
443446
```
444447

445448
## AzureResourceSchema

specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json

+30
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,36 @@
9797
}
9898
}
9999
},
100+
"ErrorDetailsWithNestedDetails": {
101+
"description": "The details of the error.",
102+
"type": "object",
103+
"allOf": [
104+
{
105+
"$ref": "#/definitions/ErrorDetails"
106+
}
107+
],
108+
"properties": {
109+
"details": {
110+
"type": "array",
111+
"readOnly": true,
112+
"description": "The additional details of the error.",
113+
"items": {
114+
"$ref": "#/definitions/ErrorDetails"
115+
},
116+
"x-ms-identifiers": []
117+
}
118+
}
119+
},
120+
"ErrorResponseWithNestedDetails": {
121+
"description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.",
122+
"type": "object",
123+
"properties": {
124+
"error": {
125+
"description": "The details of the error.",
126+
"$ref": "#/definitions/ErrorDetailsWithNestedDetails"
127+
}
128+
}
129+
},
100130
"CostManagementOperation": {
101131
"description": "A Cost management REST API operation.",
102132
"type": "object",

specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"default": {
7474
"description": "Error response describing why the operation failed.",
7575
"schema": {
76-
"$ref": "common-types.json#/definitions/ErrorResponse"
76+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
7777
}
7878
}
7979
},
@@ -125,7 +125,7 @@
125125
"default": {
126126
"description": "Error response describing why the operation failed.",
127127
"schema": {
128-
"$ref": "common-types.json#/definitions/ErrorResponse"
128+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
129129
}
130130
}
131131
},
@@ -179,7 +179,7 @@
179179
"default": {
180180
"description": "Error response describing why the operation failed.",
181181
"schema": {
182-
"$ref": "common-types.json#/definitions/ErrorResponse"
182+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
183183
}
184184
}
185185
}
@@ -216,7 +216,7 @@
216216
"default": {
217217
"description": "Error response describing why the operation failed.",
218218
"schema": {
219-
"$ref": "common-types.json#/definitions/ErrorResponse"
219+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
220220
}
221221
}
222222
}
@@ -253,7 +253,7 @@
253253
"default": {
254254
"description": "Error response describing why the operation failed.",
255255
"schema": {
256-
"$ref": "common-types.json#/definitions/ErrorResponse"
256+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
257257
}
258258
}
259259
}
@@ -310,7 +310,7 @@
310310
"default": {
311311
"description": "Error response describing why the operation failed.",
312312
"schema": {
313-
"$ref": "common-types.json#/definitions/ErrorResponse"
313+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
314314
}
315315
}
316316
}
@@ -350,7 +350,7 @@
350350
"default": {
351351
"description": "Error response describing why the operation failed.",
352352
"schema": {
353-
"$ref": "common-types.json#/definitions/ErrorResponse"
353+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
354354
}
355355
}
356356
}
@@ -390,7 +390,7 @@
390390
"default": {
391391
"description": "Error response describing why the operation failed.",
392392
"schema": {
393-
"$ref": "common-types.json#/definitions/ErrorResponse"
393+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
394394
}
395395
}
396396
}
@@ -423,7 +423,7 @@
423423
"default": {
424424
"description": "Error response describing why the operation failed.",
425425
"schema": {
426-
"$ref": "common-types.json#/definitions/ErrorResponse"
426+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
427427
}
428428
}
429429
}
@@ -459,7 +459,7 @@
459459
"default": {
460460
"description": "Error response describing why the operation failed.",
461461
"schema": {
462-
"$ref": "common-types.json#/definitions/ErrorResponse"
462+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
463463
}
464464
}
465465
}
@@ -501,7 +501,7 @@
501501
"default": {
502502
"description": "Error response describing why the operation failed.",
503503
"schema": {
504-
"$ref": "common-types.json#/definitions/ErrorResponse"
504+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
505505
}
506506
}
507507
}
@@ -546,7 +546,7 @@
546546
"default": {
547547
"description": "Error response describing why the operation failed.",
548548
"schema": {
549-
"$ref": "common-types.json#/definitions/ErrorResponse"
549+
"$ref": "common-types.json#/definitions/ErrorResponseWithNestedDetails"
550550
}
551551
}
552552
}

0 commit comments

Comments
 (0)