-
Notifications
You must be signed in to change notification settings - Fork 5.2k
/
Copy pathcostmanagement.generatedetailedcostreport.json
375 lines (375 loc) · 14.6 KB
/
costmanagement.generatedetailedcostreport.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
{
"swagger": "2.0",
"info": {
"version": "2021-10-01",
"title": "CostManagementClient"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow.",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport": {
"post": {
"tags": [
"UsageDetails"
],
"operationId": "GenerateDetailedCostReport_CreateOperation",
"description": "Generates the detailed cost report for provided date range, billing period(Only enterprise customers) or Invoice Id asynchronously at a certain scope. Call returns a 202 with header Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation will provide the status and if the operation is completed the blob file where generated detailed cost report is being stored.",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/"
},
"x-ms-examples": {
"GenerateDetailedCostReportByBillingProfileAndInvoiceId": {
"$ref": "./examples/GenerateDetailedCostReportByBillingProfileAndInvoiceId.json"
},
"GenerateDetailedCostReportBySubscriptionAndTimePeriod": {
"$ref": "./examples/GenerateDetailedCostReportBySubscriptionAndTimePeriod.json"
},
"GenerateDetailedCostReportByCustomerAndTimePeriod": {
"$ref": "./examples/GenerateDetailedCostReportByCustomerAndTimePeriod.json"
},
"GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId": {
"$ref": "./examples/GenerateDetailedCostReportByBillingProfileAndInvoiceIdAndCustomerId.json"
},
"GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod": {
"$ref": "./examples/GenerateDetailedCostReportByBillingAccountLegacyAndBillingPeriod.json"
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
},
"parameters": [
{
"$ref": "#/parameters/scopeUsageDetailsParameter"
},
{
"$ref": "common-types.json#/parameters/apiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/GenerateDetailedCostReportDefinition"
},
"description": "Parameters supplied to the Create detailed cost report operation."
}
],
"responses": {
"200": {
"description": "Request processing completed.",
"schema": {
"$ref": "#/definitions/GenerateDetailedCostReportOperationResult"
}
},
"202": {
"description": "Accepted. Request will be processed. Use the Location header to check the status.",
"headers": {
"Location": {
"description": "The URL to check the result of the asynchronous operation.",
"type": "string"
},
"Azure-Consumption-AsyncOperation": {
"description": "The URL to check the status of the asynchronous operation.",
"type": "string"
},
"Azure-AsyncOperation": {
"description": "The URL to check the status of the asynchronous operation.",
"type": "string"
},
"Retry-After": {
"description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.",
"format": "int32",
"type": "integer"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/GenerateDetailedCostReportErrorResponse"
}
}
}
}
},
"/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}": {
"get": {
"tags": [
"GenerateDetailedCostReportOperationResults"
],
"operationId": "GenerateDetailedCostReportOperationResults_Get",
"description": "Get the result of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header.",
"x-ms-examples": {
"Get details of the operation result": {
"$ref": "./examples/GenerateDetailedCostReportOperationResultsBySubscriptionScope.json"
}
},
"parameters": [
{
"name": "operationId",
"in": "path",
"required": true,
"type": "string",
"description": "The target operation Id."
},
{
"$ref": "#/parameters/scopeUsageDetailsParameter"
},
{
"$ref": "common-types.json#/parameters/apiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/GenerateDetailedCostReportOperationResult"
}
},
"202": {
"description": "Accepted. The operation is ongoing."
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "common-types.json#/definitions/ErrorResponse"
}
}
}
}
},
"/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}": {
"get": {
"tags": [
"GenerateDetailedCostReportOperationStatus"
],
"operationId": "GenerateDetailedCostReportOperationStatus_Get",
"description": "Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport creation request response header.",
"x-ms-examples": {
"Get details of the operation status": {
"$ref": "./examples/GenerateDetailedCostReportOperationStatusBySubscriptionScope.json"
}
},
"parameters": [
{
"name": "operationId",
"in": "path",
"required": true,
"type": "string",
"description": "The target operation Id."
},
{
"$ref": "#/parameters/scopeUsageDetailsParameter"
},
{
"$ref": "common-types.json#/parameters/apiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/GenerateDetailedCostReportOperationStatuses"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "common-types.json#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {
"GenerateDetailedCostReportErrorResponse": {
"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 * 413 Request Entity Too Large - Request is throttled. The amount of data required to fulfill the request exceeds the maximum size permitted of 2Gb. Please utilize our Exports feature instead. \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.",
"type": "object",
"properties": {
"error": {
"description": "The details of the error.",
"$ref": "common-types.json#/definitions/ErrorDetails"
}
}
},
"GenerateDetailedCostReportDefinition": {
"description": "The definition of a cost detailed report.",
"properties": {
"metric": {
"description": "The type of the detailed report. By default ActualCost is provided",
"type": "string",
"enum": [
"ActualCost",
"AmortizedCost"
],
"x-ms-enum": {
"name": "GenerateDetailedCostReportMetricType",
"modelAsString": true
}
},
"timePeriod": {
"description": "Has time period for pulling data for the cost detailed report. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.",
"$ref": "#/definitions/GenerateDetailedCostReportTimePeriod"
},
"billingPeriod": {
"description": "Billing Period in YearMonth(e.g. 202008) format. Only for legacy enterprise customers can use this. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.",
"type": "string"
},
"invoiceId": {
"description": "Invoice Id for PayAsYouGo customers and Modern billing profile scope. Can only have one of either timePeriod or invoiceId or billingPeriod parameters. If none provided current month cost is provided.",
"type": "string"
},
"customerId": {
"description": "Customer Id for Modern (Invoice Id and billing profile is also required for this).",
"type": "string"
}
}
},
"GenerateDetailedCostReportTimePeriod": {
"description": "The start and end date for pulling data for the cost detailed report.",
"properties": {
"start": {
"description": "The start date to pull data from. example format 2020-03-15",
"type": "string"
},
"end": {
"description": "The end date to pull data to. example format 2020-03-15",
"type": "string"
}
},
"required": [
"start",
"end"
]
},
"GenerateDetailedCostReportOperationStatuses": {
"description": "The status of the long running operation for cost detailed report.",
"properties": {
"id": {
"description": "The id of the long running operation.",
"type": "string"
},
"name": {
"description": "The name of the long running operation.",
"type": "string"
},
"status": {
"description": "The status of the long running operation.",
"$ref": "#/definitions/Status"
},
"type": {
"description": "The type of the long running operation.",
"type": "string"
},
"error": {
"description": "The details of the error.",
"$ref": "common-types.json#/definitions/ErrorDetails"
},
"properties": {
"x-ms-client-flatten": true,
"type": "object",
"description": "The properties of the resource generated.",
"$ref": "#/definitions/DownloadURL"
}
}
},
"GenerateDetailedCostReportOperationResult": {
"description": "The result of the long running operation for cost detailed report.",
"properties": {
"id": {
"description": "The id of the long running operation.",
"type": "string"
},
"name": {
"description": "The name of the long running operation.",
"type": "string"
},
"type": {
"description": "The type of the long running operation.",
"type": "string"
},
"properties": {
"x-ms-client-flatten": true,
"type": "object",
"description": "The properties of the resource generated.",
"$ref": "#/definitions/DownloadURL"
}
}
},
"DownloadURL": {
"description": "The URL to download the generated report.",
"properties": {
"downloadUrl": {
"description": "The URL to download the generated report.",
"type": "string"
},
"validTill": {
"description": "The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z.",
"type": "string",
"format": "date-time"
}
}
},
"Status": {
"description": "The status of the long running operation.",
"properties": {
"status": {
"description": "The status of the long running operation.",
"type": "string",
"enum": [
"InProgress",
"Completed",
"Failed",
"Queued",
"NoDataFound",
"ReadyToDownload",
"TimedOut"
],
"x-ms-enum": {
"name": "ReportOperationStatusType",
"modelAsString": true
}
}
}
}
},
"parameters": {
"scopeUsageDetailsParameter": {
"name": "scope",
"in": "path",
"required": true,
"type": "string",
"description": "The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.",
"x-ms-parameter-location": "method",
"x-ms-skip-url-encoding": true
}
}
}