Skip to content

Commit 740b641

Browse files
pthippeswamytadelesh
authored andcommitted
[Hub Generated] Review request for Microsoft.Consumption to add version stable/2023-03-01 (Azure#23914)
* EA Pricesheet download documentation. * Model validation error fix * readme edit to add consumption_pricesheet.json * corrections * Proper braces * corrections * corrections * edits * corrections * edit * Removed unwanted path and example file * Added error response back * Call method correction * validating Linter error - testing * Removed errorResponse to common file * errorResponse * Adding common-types json to readme * ErrorDetail addition * Removed common-types. Edits to correct Linter issues. * removed the reference to old file * CI issues fixed * Corrections based on PR comment * rename * SDK error fix * Delete consumption.json * Revert "SDK error fix" This reverts commit e0d3154. * Suppression for Linter error * supression * supression * supression error * resolve go duplicate schema issue * Changes per - https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdev.azure.com%2Fazure-sdk%2Finternal%2F_wiki%2Fwikis%2Finternal.wiki%2F828%2FHow-to-suppress-validation-rules%3Fanchor%3Dnew-guidance-as-of-5%2F15%2F2023&data=05%7C01%7Cpthippeswamy%40microsoft.com%7C1975ac464e674af18df308db672967e8%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638217199804383965%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=L6ZelM9GpeDUHthYwX%2Fgb0BCM6aBTNKxMOT548n2rNc%3D&reserved=0 * correction * correcting suppression format * revert suppression --------- Co-authored-by: Chenjie Shi <[email protected]>
1 parent 9928ed1 commit 740b641

File tree

4 files changed

+189
-1
lines changed

4 files changed

+189
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"version": "2023-03-01",
5+
"title": "ConsumptionManagementClient",
6+
"description": "Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions."
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow.",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/download": {
38+
"post": {
39+
"tags": [
40+
"PriceSheet"
41+
],
42+
"operationId": "PriceSheet_DownloadByBillingAccountPeriod",
43+
"description": "Generates the pricesheet for the provided billing period asynchronously based on the enrollment id",
44+
"externalDocs": {
45+
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/"
46+
},
47+
"x-ms-long-running-operation": true,
48+
"x-ms-long-running-operation-options": {
49+
"final-state-via": "location"
50+
},
51+
"x-ms-examples": {
52+
"EAPriceSheetForBillingPeriod": {
53+
"$ref": "./examples/EAPriceSheetForBillingPeriod.json"
54+
}
55+
},
56+
"parameters": [
57+
{
58+
"$ref": "#/parameters/billingAccountIdParameter"
59+
},
60+
{
61+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
62+
},
63+
{
64+
"$ref": "#/parameters/billingPeriodNameParameter"
65+
}
66+
],
67+
"responses": {
68+
"200": {
69+
"description": "Request processing completed.",
70+
"schema": {
71+
"$ref": "#/definitions/OperationStatus"
72+
}
73+
},
74+
"202": {
75+
"description": "Accepted",
76+
"headers": {
77+
"Location": {
78+
"type": "string"
79+
},
80+
"Retry-After": {
81+
"type": "integer",
82+
"format": "int64"
83+
}
84+
}
85+
},
86+
"default": {
87+
"description": "Error response describing why the operation failed.",
88+
"schema": {
89+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
90+
}
91+
}
92+
}
93+
}
94+
}
95+
},
96+
"definitions": {
97+
"OperationStatus": {
98+
"description": "The status of the long running operation.",
99+
"type": "object",
100+
"properties": {
101+
"status": {
102+
"description": "The status of the long running operation.",
103+
"type": "string",
104+
"enum": [
105+
"Running",
106+
"Completed",
107+
"Failed"
108+
],
109+
"x-ms-enum": {
110+
"name": "OperationStatusType",
111+
"modelAsString": true
112+
}
113+
},
114+
"properties": {
115+
"x-ms-client-flatten": true,
116+
"description": "The properties of the resource generated.",
117+
"$ref": "#/definitions/PricesheetDownloadProperties"
118+
}
119+
}
120+
},
121+
"PricesheetDownloadProperties": {
122+
"description": "The properties of the price sheet download.",
123+
"type": "object",
124+
"properties": {
125+
"downloadUrl": {
126+
"description": "The link (url) to download the pricesheet.",
127+
"type": "string",
128+
"readOnly": true
129+
},
130+
"validTill": {
131+
"description": "Download link validity.",
132+
"type": "string",
133+
"format": "date-time",
134+
"readOnly": true
135+
}
136+
}
137+
}
138+
},
139+
"parameters": {
140+
"billingAccountIdParameter": {
141+
"name": "billingAccountId",
142+
"in": "path",
143+
"description": "BillingAccount ID",
144+
"required": true,
145+
"type": "string",
146+
"x-ms-parameter-location": "method"
147+
},
148+
"billingPeriodNameParameter": {
149+
"name": "billingPeriodName",
150+
"in": "path",
151+
"description": "Billing Period Name.",
152+
"required": true,
153+
"type": "string",
154+
"pattern": "^[0-9]*$",
155+
"x-ms-parameter-location": "method"
156+
}
157+
}
158+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"parameters": {
3+
"api-version": "2023-03-01",
4+
"billingAccountId": "0000000",
5+
"billingPeriodName": "202305"
6+
},
7+
"responses": {
8+
"202": {
9+
"headers": {
10+
"Location": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/0000000/providers/Microsoft.Consumption/operationResults/00000000-0000-0000-0000-000000000000?api-version=2023-03-01",
11+
"Retry-After": 10
12+
}
13+
},
14+
"200": {
15+
"body": {
16+
"status": "Completed",
17+
"properties": {
18+
"downloadUrl": "https://xxxxxx.blob.core.windows.net/armpricesheetreportdownloadcontainer/20230510/00000000-0000-0000-0000-000000000000",
19+
"validTill": "2023-05-11T05:12:50.4266333Z"
20+
}
21+
}
22+
}
23+
}
24+
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ module-name: sdk/resourcemanager/consumption/armconsumption
1515
module: github.com/Azure/azure-sdk-for-go/$(module-name)
1616
output-folder: $(go-sdk-folder)/$(module-name)
1717
azure-arm: true
18+
directive:
19+
- from: consumption_pricesheet.json
20+
where: $.paths["/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/download"].post.responses.default.schema
21+
transform: >
22+
$["$ref"] = "consumption.json#/definitions/ErrorResponse";
1823
```
1924
2025
### Go multi-api
@@ -121,4 +126,4 @@ Please also specify `--go-sdk-folder=<path to the root directory of your azure-s
121126

122127
``` yaml $(tag) == 'package-2019-01' && $(go)
123128
output-folder: $(go-sdk-folder)/services/consumption/mgmt/2019-01-01/consumption
124-
```
129+
```

specification/consumption/resource-manager/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ These settings apply only when `--tag=package-2023-03` is specified on the comma
3737
```yaml $(tag) == 'package-2023-03'
3838
input-file:
3939
- Microsoft.Consumption/stable/2023-03-01/consumption.json
40+
- Microsoft.Consumption/stable/2023-03-01/consumption_pricesheet.json
4041
```
4142
### Tag: package-2022-09
4243

0 commit comments

Comments
 (0)