Skip to content

Commit

Permalink
[Hub Generated] Review request for Microsoft.Consumption to add versi…
Browse files Browse the repository at this point in the history
…on 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 <tadelesh.shi@live.cn>
  • Loading branch information
2 people authored and harryli0108 committed Jul 28, 2023
1 parent 9928ed1 commit 740b641
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"swagger": "2.0",
"info": {
"version": "2023-03-01",
"title": "ConsumptionManagementClient",
"description": "Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions."
},
"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": {
"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/download": {
"post": {
"tags": [
"PriceSheet"
],
"operationId": "PriceSheet_DownloadByBillingAccountPeriod",
"description": "Generates the pricesheet for the provided billing period asynchronously based on the enrollment id",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/"
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
},
"x-ms-examples": {
"EAPriceSheetForBillingPeriod": {
"$ref": "./examples/EAPriceSheetForBillingPeriod.json"
}
},
"parameters": [
{
"$ref": "#/parameters/billingAccountIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/billingPeriodNameParameter"
}
],
"responses": {
"200": {
"description": "Request processing completed.",
"schema": {
"$ref": "#/definitions/OperationStatus"
}
},
"202": {
"description": "Accepted",
"headers": {
"Location": {
"type": "string"
},
"Retry-After": {
"type": "integer",
"format": "int64"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {
"OperationStatus": {
"description": "The status of the long running operation.",
"type": "object",
"properties": {
"status": {
"description": "The status of the long running operation.",
"type": "string",
"enum": [
"Running",
"Completed",
"Failed"
],
"x-ms-enum": {
"name": "OperationStatusType",
"modelAsString": true
}
},
"properties": {
"x-ms-client-flatten": true,
"description": "The properties of the resource generated.",
"$ref": "#/definitions/PricesheetDownloadProperties"
}
}
},
"PricesheetDownloadProperties": {
"description": "The properties of the price sheet download.",
"type": "object",
"properties": {
"downloadUrl": {
"description": "The link (url) to download the pricesheet.",
"type": "string",
"readOnly": true
},
"validTill": {
"description": "Download link validity.",
"type": "string",
"format": "date-time",
"readOnly": true
}
}
}
},
"parameters": {
"billingAccountIdParameter": {
"name": "billingAccountId",
"in": "path",
"description": "BillingAccount ID",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"billingPeriodNameParameter": {
"name": "billingPeriodName",
"in": "path",
"description": "Billing Period Name.",
"required": true,
"type": "string",
"pattern": "^[0-9]*$",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"api-version": "2023-03-01",
"billingAccountId": "0000000",
"billingPeriodName": "202305"
},
"responses": {
"202": {
"headers": {
"Location": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/0000000/providers/Microsoft.Consumption/operationResults/00000000-0000-0000-0000-000000000000?api-version=2023-03-01",
"Retry-After": 10
}
},
"200": {
"body": {
"status": "Completed",
"properties": {
"downloadUrl": "https://xxxxxx.blob.core.windows.net/armpricesheetreportdownloadcontainer/20230510/00000000-0000-0000-0000-000000000000",
"validTill": "2023-05-11T05:12:50.4266333Z"
}
}
}
}
}
7 changes: 6 additions & 1 deletion specification/consumption/resource-manager/readme.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ module-name: sdk/resourcemanager/consumption/armconsumption
module: github.com/Azure/azure-sdk-for-go/$(module-name)
output-folder: $(go-sdk-folder)/$(module-name)
azure-arm: true
directive:
- from: consumption_pricesheet.json
where: $.paths["/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/download"].post.responses.default.schema
transform: >
$["$ref"] = "consumption.json#/definitions/ErrorResponse";
```
### Go multi-api
Expand Down Expand Up @@ -121,4 +126,4 @@ Please also specify `--go-sdk-folder=<path to the root directory of your azure-s

``` yaml $(tag) == 'package-2019-01' && $(go)
output-folder: $(go-sdk-folder)/services/consumption/mgmt/2019-01-01/consumption
```
```
1 change: 1 addition & 0 deletions specification/consumption/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ These settings apply only when `--tag=package-2023-03` is specified on the comma
```yaml $(tag) == 'package-2023-03'
input-file:
- Microsoft.Consumption/stable/2023-03-01/consumption.json
- Microsoft.Consumption/stable/2023-03-01/consumption_pricesheet.json
```
### Tag: package-2022-09

Expand Down

0 comments on commit 740b641

Please sign in to comment.