From 78c169476e5e3972611ee363b4d5332bb34d6bf0 Mon Sep 17 00:00:00 2001 From: janakiramachandran <94479298+janakiramachandran@users.noreply.github.com> Date: Sun, 27 Feb 2022 22:03:23 -0800 Subject: [PATCH] [Hub Generated] Public private branch 'janakiramachandran-ps-download' (#17982) * Add files via upload * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update readme.md * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update PricesheetDownloadByBillingProfile.json * Update PricesheetDownload.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Create OperationList * Update costmanagement.pricesheets.json * Rename OperationList to OperationList.json * Update OperationList.json * Update OperationList.json * Update OperationList.json * Update costmanagement.pricesheets.json * Update OperationList.json * Update OperationList.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * Update costmanagement.pricesheets.json * PrettierNPM --- .../costmanagement.pricesheets.json | 400 ++++++++++++++++++ .../examples/OperationList.json | 22 + .../examples/PricesheetDownload.json | 23 + .../PricesheetDownloadByBillingProfile.json | 22 + .../resource-manager/readme.md | 7 + 5 files changed, 474 insertions(+) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/costmanagement.pricesheets.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/OperationList.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownload.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownloadByBillingProfile.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/costmanagement.pricesheets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/costmanagement.pricesheets.json new file mode 100644 index 000000000000..4293eb75935d --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/costmanagement.pricesheets.json @@ -0,0 +1,400 @@ +{ + "swagger": "2.0", + "info": { + "version": "2022-02-01-preview", + "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": { + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices/{invoiceName}/providers/Microsoft.CostManagement/pricesheets/default/download": { + "post": { + "tags": [ + "PriceSheets" + ], + "x-ms-examples": { + "PricesheetDownload": { + "$ref": "./examples/PricesheetDownload.json" + } + }, + "operationId": "PriceSheet_Download", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "description": "Gets a URL to download the pricesheet for an invoice. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/billingProfileNameParameter" + }, + { + "$ref": "#/parameters/invoiceNameParameter" + } + ], + "responses": { + "202": { + "description": "Accepted.", + "headers": { + "Location": { + "description": "GET this URL to retrieve 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.", + "type": "string" + }, + "OData-EntityId": { + "description": "The operation entity Id GUID.", + "type": "string" + } + } + }, + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DownloadUrl" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/providers/Microsoft.CostManagement/pricesheets/default/download": { + "post": { + "tags": [ + "PriceSheets" + ], + "x-ms-examples": { + "PricesheetDownloadByBillingProfile": { + "$ref": "./examples/PricesheetDownloadByBillingProfile.json" + } + }, + "operationId": "PriceSheet_DownloadByBillingProfile", + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "description": "Gets a URL to download the current month's pricesheet for a billing profile. The operation is supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement.Due to Azure product growth, the Azure price sheet download experience in this preview version will be updated from a single csv file to a Zip file containing multiple csv files, each with max 200k records.The name of the zip file is AzurePricesheet as gzip.The names of multiple csv files are AzurePricesheet _1, AzurePricesheet _2", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountNameParameter" + }, + { + "$ref": "#/parameters/billingProfileNameParameter" + } + ], + "responses": { + "202": { + "description": "Accepted.", + "headers": { + "Location": { + "description": "GET this URL to retrieve 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.", + "type": "string" + }, + "OData-EntityId": { + "description": "The operation entity Id GUID.", + "type": "string" + } + } + }, + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DownloadUrl" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.CostManagement/operations": { + "get": { + "tags": [ + "Operations" + ], + "x-ms-examples": { + "OperationsList": { + "$ref": "./examples/OperationList.json" + } + }, + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/cost-management/" + }, + "operationId": "Operations_List", + "description": "Lists all of the available consumption REST API operations.", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "Error": { + "description": "Error details for transfer execution.", + "type": "object", + "properties": { + "errorCode": { + "type": "string", + "readOnly": true, + "description": "Error code." + }, + "errorMessage": { + "type": "string", + "readOnly": true, + "description": "Error message." + } + } + }, + "Operation": { + "description": "A Consumption REST API operation.", + "type": "object", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Operation Id." + }, + "name": { + "description": "Operation name: {provider}/{resource}/{operation}.", + "type": "string", + "readOnly": true + }, + "isDataAction": { + "description": "Indicates whether the operation is a data action", + "type": "boolean" + }, + "display": { + "description": "The object that represents the operation.", + "type": "object", + "properties": { + "provider": { + "description": "Service provider: Microsoft.Consumption.", + "type": "string", + "readOnly": true + }, + "resource": { + "description": "Resource on which the operation is performed: UsageDetail, etc.", + "type": "string", + "readOnly": true + }, + "operation": { + "description": "Operation type: Read, write, delete, etc.", + "type": "string", + "readOnly": true + }, + "description": { + "description": "Description of the operation.", + "type": "string", + "readOnly": true + } + } + } + } + }, + "OperationListResult": { + "description": "Result of listing consumption operations. It contains a list of operations and a URL link to get the next set of results.", + "type": "object", + "properties": { + "value": { + "description": "List of consumption operations supported by the Microsoft.Consumption resource provider.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Operation" + } + }, + "nextLink": { + "description": "URL to get the next set of operation list results if there are any.", + "type": "string", + "readOnly": true + } + } + }, + "ErrorDetails": { + "description": "The details of the error.", + "type": "object", + "properties": { + "code": { + "description": "Error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string", + "readOnly": true + } + } + }, + "ErrorResponse": { + "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.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "DownloadUrl": { + "description": "A secure URL that can be used to download a an entity until the URL expires.", + "type": "object", + "properties": { + "expiryTime": { + "description": "The time in UTC when the download URL will expire.", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "description": "The URL to the ZIP file. This Zip file will consists of multiple CSV files", + "type": "string", + "readOnly": true + } + } + }, + "ProxyResource": { + "description": "The Resource model definition.", + "type": "object", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + }, + "eTag": { + "type": "string", + "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." + } + }, + "x-ms-azure-resource": true + } + }, + "parameters": { + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request." + }, + "billingAccountNameParameter": { + "name": "billingAccountName", + "in": "path", + "description": "The ID that uniquely identifies a billing account.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "billingProfileNameParameter": { + "name": "billingProfileName", + "in": "path", + "description": "The ID that uniquely identifies a billing profile.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "operationIdParameter": { + "name": "operationId", + "in": "path", + "description": "Operation Id.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "billingAccountIdParameter": { + "name": "billingAccountId", + "in": "path", + "description": "BillingAccount ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "invoiceNameParameter": { + "name": "invoiceName", + "in": "path", + "description": "The ID that uniquely identifies an invoice.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/OperationList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/OperationList.json new file mode 100644 index 000000000000..39cd69d083f3 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/OperationList.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2022-02-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "display": { + "description": "Cost Management allowed operations", + "provider": "Microsoft.CostManagement", + "resource": "Pricesheets" + }, + "id": "edbb014c-80ca-55f8-ffe8-5b0e223f3c96", + "name": "/providers/Microsoft.CostManagement/OperationStatus" + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownload.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownload.json new file mode 100644 index 000000000000..96fc1c914d5b --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownload.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2022-02-01-preview", + "billingAccountName": "{billingAccountName}", + "billingProfileName": "{billingProfileName}", + "invoiceName": "{invoiceName}" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.Billing/operationResults/45000000-0000-0000-0000-000000000000?api-version=2018-07-31", + "Retry-After": "60", + "OData-EntityId": "45000000-0000-0000-0000-000000000000" + } + }, + "200": { + "body": { + "url": "https://myaccount.blob.core.windows.net/?restype=service&comp=properties&sv=2015-04-05&ss=bf&srt=s&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&spr=https&sig=G%2TEST%4B", + "expiryTime": "2018-07-21T17:32:28Z" + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownloadByBillingProfile.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownloadByBillingProfile.json new file mode 100644 index 000000000000..71769ba075bc --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-02-01-preview/examples/PricesheetDownloadByBillingProfile.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2022-02-01-preview", + "billingAccountName": "{billingAccountName}", + "billingProfileName": "{billingProfileName}" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.Billing/operationResults/45000000-0000-0000-0000-000000000000?api-version=2018-07-31", + "Retry-After": "60", + "OData-EntityId": "45000000-0000-0000-0000-000000000000" + } + }, + "200": { + "body": { + "url": "https://myaccount.blob.core.windows.net/?restype=service&comp=properties&sv=2015-04-05&ss=bf&srt=s&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&spr=https&sig=G%2TEST%4B", + "expiryTime": "2018-07-21T17:32:28Z" + } + } + } +} diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index ae3b3baaba51..c9551807a56f 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -31,7 +31,14 @@ azure-validator: false ``` --- +### Tag: package-preview-2022-02 +These settings apply only when `--tag=package-preview-2022-02` is specified on the command line. + +```yaml $(tag) == 'package-preview-2022-02' +input-file: + - Microsoft.CostManagement/preview/2022-02-01-preview/costmanagement.pricesheets.json +``` ### Tag: package-2021-10