Skip to content

Commit bb28865

Browse files
JoeBeach-msftaviyerMSFT
authored andcommitted
UsageV3 S360 Updates (Azure#22637)
* UsageV3 S360 Updates Corrected three items that were flagging for swagger compliance in S360. Added definitions for 202 responses and added 'error' as a property to definition for 'ErrorResponse'. * Removed 202 Response for Ratecard Removed the 202 response for Ratecard Ratecard is a different service that is not getting flagged for in S360 and does not support 202 response code. * Undo ErrorMessage Properties Swagger will not let ErrorResponse contain an error property with subproperties. Reverting ErrorResponse to contain "code" and "message" as its properties. * Ran Prettier Ran prettier in order to address Pull Request check. * Added xm-ms-long-running-operation Property Added xm-ms-long-running-operation Property to the UsageAggregates_List get call in order to justify the addition of the 202 response. * Added x-ms-long-running-operation-options Added x-ms-long-running-operation-options. Adding a 202 response requires that these options be set. * Prettier Run Reran prettier after the last commit to correct formatting issues. * Added x-ms-example for GetUsageAggregates_List Added x-ms-example for GetUsageAggregates_List. PR check was flagging because there was no example present. Will create the referenced json file in the next commit. * Added example file for UsageAggregates List There was previously no example for UsageAggregates List, but there was one for RateCard. The following documentation was used to generate this example file. https://learn.microsoft.com/en-us/previous-versions/azure/reference/mt219001(v=azure.100)?redirectedfrom=MSDN#sample-responses * Corrected Formatting for UsageAggregatesList Example Value Array was missing brackets for its element. * Corrected Example File Name Corrected the file name to exclude an underscore. * Added Location Header to 202 Response Added location header to the 202 response. * Corrected Location to use double quotes Corrected formatting issue with the previous commit that added a location header to the 202 response. * Updated Example Fields Updated infofields to match the example given in the api documentation. * Added 202 Response Added a 202 response to the example file. * GetUsageAggregatesList.json Prettier Update Reran Prettier script on GetUsageAggregatesList.json * Updated case 'Daily' and Example 202 Response Updated case 'Daily' and Example 202 Response. These changes were made previously, but lost at some point. * Removed Error from 202 Body Error property not allowed in the response. * Removed InfoFields properties. Removed all subproperties for InfoFields. Our api no longer returns any properties for InfoFields. * Removed Infofields properties. Removed Infofields properties. Our api no longer returns any of these properties in a 200 response. * Removed InfoFields Properties Removed Property from InfoFields. This should have been removed along with the other properties in the previous commit. * Removed LongRunning operation Removed longrunning operation from UsageAggregates_List. * Removed Location Header Location header no longer needed.
1 parent 14bf0f3 commit bb28865

File tree

2 files changed

+53
-6
lines changed

2 files changed

+53
-6
lines changed

specification/commerce/resource-manager/Microsoft.Commerce/preview/2015-06-01-preview/commerce.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"externalDocs": {
2828
"url": "https://docs.microsoft.com/rest/api/commerce/usageaggregates"
2929
},
30+
"x-ms-examples": {
31+
"GetUsageAggregatesList": {
32+
"$ref": "./examples/GetUsageAggregatesList.json"
33+
}
34+
},
3035
"parameters": [
3136
{
3237
"name": "reportedStartTime",
@@ -88,6 +93,12 @@
8893
"$ref": "#/definitions/UsageAggregationListResult"
8994
}
9095
},
96+
"202": {
97+
"description": "Response indicating that a request has been accepted for processing. However, the processing has not been completed.",
98+
"schema": {
99+
"$ref": "#/definitions/ErrorResponse"
100+
}
101+
},
91102
"default": {
92103
"description": "Error response describing why the operation failed.",
93104
"schema": {
@@ -150,12 +161,6 @@
150161
},
151162
"definitions": {
152163
"InfoField": {
153-
"properties": {
154-
"project": {
155-
"type": "string",
156-
"description": "Identifies the name of the instance provisioned by the user."
157-
}
158-
},
159164
"description": "Key-value pairs of instance details in the legacy format."
160165
},
161166
"UsageSample": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"title": "Get UsageAggregatesList",
3+
"parameters": {
4+
"subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b",
5+
"api-version": "2015-06-01-preview",
6+
"reportedStartTime": "2014-05-01T00:00:00+00:00",
7+
"reportedEndTime": "2015-06-01T00:00:00+00:00",
8+
"aggregationGranularity": "Daily",
9+
"showDetails": "true"
10+
},
11+
"responses": {
12+
"200": {
13+
"body": {
14+
"value": [
15+
{
16+
"id": "/subscriptions/f68815e6-3c41-45ef-bbd8-5f83303c396b/providers/Microsoft.Commerce/UsageAggregates/Daily_BRSDT_20140501_0000",
17+
"name": "Daily_BRSDT_20140501_0000",
18+
"type": "Microsoft.Commerce/UsageAggregate",
19+
"properties": {
20+
"subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b",
21+
"usageStartTime": "2015-03-03T00:00:00+00:00",
22+
"usageEndTime": "2015-03-04T00:00:00+00:00",
23+
"meterName": "Standard IO – Page Blob/Disk (GB)",
24+
"meterCategory": "Storage",
25+
"meterSubCategory": "Geo Redundant",
26+
"unit": "GB",
27+
"meterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4",
28+
"infoFields": {},
29+
"quantity": 0.057865
30+
}
31+
}
32+
]
33+
}
34+
},
35+
"202": {
36+
"body": {
37+
"code": "aaaaaaaaaaaaaaaaaaaaaa",
38+
"message": "aaaaaaaaaaaaaaaaaaaa"
39+
}
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)