From af1182b9eee513c0c0359f416bb65d9520675b7a Mon Sep 17 00:00:00 2001 From: Alex Goldschmidt Date: Mon, 4 Apr 2022 16:38:06 -0400 Subject: [PATCH 1/6] Fix swagger issues from s360 --- .../stable/2019-10-01/consumption.json | 210 +++++++++++++++++- ...nloadByBillingAccountForBillingPeriod.json | 17 ++ .../CreditSummaryByBillingProfile.json | 3 +- .../examples/CreditSummaryByCustomer.json | 3 +- ...nloadByBillingAccountForBillingPeriod.json | 18 ++ .../examples/PriceSheetDownload.json | 17 ++ 6 files changed, 262 insertions(+), 6 deletions(-) create mode 100644 specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/BalancesDownloadByBillingAccountForBillingPeriod.json create mode 100644 specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/MarketplacesDownloadByBillingAccountForBillingPeriod.json create mode 100644 specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/PriceSheetDownload.json diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json index c6a19e934001..3a79c0d393bb 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json @@ -258,6 +258,70 @@ } } }, + "/{scope}/providers/Microsoft.Consumption/marketplaces/download": { + "get": { + "tags": [ + "Marketplaces" + ], + "x-ms-odata": "#/definitions/Marketplace", + "operationId": "Marketplaces_Download", + "description": "Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, 2014 or later.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "Balances": { + "$ref": "./examples/MarketplacesDownloadForBillingPeriod.json" + } + }, + "parameters": [ + { + "name": "$filter", + "description": "May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N marketplaces.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/scopeMarketplaceParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "202": { + "description": "OK. Accepted.", + "schema": { + "$ref": "#/definitions/ArmReport" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/{scope}/providers/Microsoft.Consumption/budgets": { "get": { "tags": [ @@ -662,6 +726,48 @@ } } }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances/download": { + "get": { + "tags": [ + "Balances" + ], + "operationId": "Balances_DownloadForBillingPeriodByBillingAccount", + "description": "Downloads the balances for a scope by billing period and billingAccountId. Balances are available via this API only for May 1, 2014 or later.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "Balances": { + "$ref": "./examples/BalancesDownloadByBillingAccountForBillingPeriod.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/billingPeriodNameParameter" + } + ], + "responses": { + "202": { + "description": "OK. Accepted.", + "schema": { + "$ref": "#/definitions/ArmReport" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries": { "get": { "tags": [ @@ -1349,6 +1455,72 @@ } } }, + "providers/microsoft.billing/billingaccounts/{billingAccountId}/billingperiods/{billingPeriod}/providers/microsoft.consumption/pricesheets/download": { + "get": { + "tags": [ + "PriceSheet" + ], + "operationId": "PriceSheet_Download", + "description": "Downloads the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or later.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/consumption/" + }, + "x-ms-examples": { + "PriceSheet": { + "$ref": "./examples/PriceSheetDownload.json" + } + }, + "parameters": [ + { + "name": "$expand", + "description": "May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the top N results.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 1000 + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/billingPeriodNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "202": { + "description": "OK. Accepted.", + "schema": { + "$ref": "#/definitions/ArmResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default": { "get": { "tags": [ @@ -1725,6 +1897,9 @@ "$ref": "#/definitions/CreditSummary" } }, + "204": { + "description": "An empty response is sent when there is no information available within the selected scope." + }, "default": { "description": "Error response describing why the operation failed.", "schema": { @@ -4526,7 +4701,7 @@ "discriminator": "kind", "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "#/definitions/ProxyResource" } ], "properties": { @@ -4604,6 +4779,12 @@ "format": "decimal", "readOnly": true }, + "azureMarketplaceCharges": { + "description": "Azure Marketplace Charges.", + "type": "number", + "format": "decimal", + "readOnly": true + }, "currency": { "description": "Currency Code", "type": "string", @@ -4854,7 +5035,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "#/definitions/ProxyResource" } ], "properties": { @@ -4991,7 +5172,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "#/definitions/ProxyResource" } ], "properties": { @@ -5077,7 +5258,7 @@ "type": "object", "allOf": [ { - "$ref": "#/definitions/Resource" + "$ref": "#/definitions/ProxyResource" } ], "properties": { @@ -5308,6 +5489,27 @@ } }, "x-ms-azure-resource": true + }, + "ArmReport": { + "description": "The Arm Report definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id." + }, + "operationResultUrl": { + "readOnly": true, + "type": "string", + "description": "OperationResultUrl." + }, + "operationStatusUrl": { + "readOnly": true, + "type": "string", + "description": "OperationStatusUrl." + } + }, + "x-ms-azure-resource": true } }, "parameters": { diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/BalancesDownloadByBillingAccountForBillingPeriod.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/BalancesDownloadByBillingAccountForBillingPeriod.json new file mode 100644 index 000000000000..85d6d61cf827 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/BalancesDownloadByBillingAccountForBillingPeriod.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2019-10-01", + "billingAccountId": "123456", + "billingPeriodName": "201702" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.Billing/operationResult/1a0a30a7-36a7-4dd6-9200-a1c23ba96151?sessiontoken=0%3A2943&api-version=2018-11-01-preview", + "Retry-After": "10", + "Azure-AsyncOperation": "https://management.azure.com/providers/Microsoft.Billing/operationStatus/1a0a30a7-36a7-4dd6-9200-a1c23ba96151?sessiontoken=0%3A2943&api-version=2018-11-01-preview", + "OData-EntityId": "84ae600f-763c-4a66-a8f0-4c497fc58d98" + } + } + } +} diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json index d1a10bbde661..6c6821a8314b 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByBillingProfile.json @@ -34,6 +34,7 @@ } } } - } + }, + "204": {} } } diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByCustomer.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByCustomer.json index 0dc6315f17fe..96400b9ca4e1 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByCustomer.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/CreditSummaryByCustomer.json @@ -52,6 +52,7 @@ } } } - } + }, + "204": {} } } diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/MarketplacesDownloadByBillingAccountForBillingPeriod.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/MarketplacesDownloadByBillingAccountForBillingPeriod.json new file mode 100644 index 000000000000..7386c5cb8f4b --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/MarketplacesDownloadByBillingAccountForBillingPeriod.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2019-10-01", + "billingAccountId": "00000000-0000-0000-0000-000000000000", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "billingPeriodName": "201801" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.Billing/operationResult/1a0a30a7-36a7-4dd6-9200-a1c23ba96151?sessiontoken=0%3A2943&api-version=2018-11-01-preview", + "Retry-After": "10", + "Azure-AsyncOperation": "https://management.azure.com/providers/Microsoft.Billing/operationStatus/1a0a30a7-36a7-4dd6-9200-a1c23ba96151?sessiontoken=0%3A2943&api-version=2018-11-01-preview", + "OData-EntityId": "84ae600f-763c-4a66-a8f0-4c497fc58d98" + } + } + } +} diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/PriceSheetDownload.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/PriceSheetDownload.json new file mode 100644 index 000000000000..1103d4beb6b9 --- /dev/null +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/examples/PriceSheetDownload.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2019-10-01", + "billingAccountId": "00000000-0000-0000-0000-000000000000", + "billingPeriodName": "201801" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.Billing/operationResult/1a0a30a7-36a7-4dd6-9200-a1c23ba96151?sessiontoken=0%3A2943&api-version=2018-11-01-preview", + "Retry-After": "10", + "Azure-AsyncOperation": "https://management.azure.com/providers/Microsoft.Billing/operationStatus/1a0a30a7-36a7-4dd6-9200-a1c23ba96151?sessiontoken=0%3A2943&api-version=2018-11-01-preview", + "OData-EntityId": "84ae600f-763c-4a66-a8f0-4c497fc58d98" + } + } + } +} From 35633cf7bcdf041979e1883c712904f0a9bc815d Mon Sep 17 00:00:00 2001 From: Alex Goldschmidt Date: Mon, 4 Apr 2022 16:53:19 -0400 Subject: [PATCH 2/6] Fix text issues --- .../Microsoft.Consumption/stable/2019-10-01/consumption.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json index 3a79c0d393bb..82a760310acb 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json @@ -271,7 +271,7 @@ }, "x-ms-examples": { "Balances": { - "$ref": "./examples/MarketplacesDownloadForBillingPeriod.json" + "$ref": "./examples/MarketplacesDownloadByBillingAccountForBillingPeriod.json" } }, "parameters": [ @@ -1455,7 +1455,7 @@ } } }, - "providers/microsoft.billing/billingaccounts/{billingAccountId}/billingperiods/{billingPeriod}/providers/microsoft.consumption/pricesheets/download": { + "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriod}/providers/microsoft.consumption/pricesheets/download": { "get": { "tags": [ "PriceSheet" From 59c93d822f20b087ec69e56875a0f91c173c48d6 Mon Sep 17 00:00:00 2001 From: Alex Goldschmidt Date: Mon, 4 Apr 2022 17:03:00 -0400 Subject: [PATCH 3/6] Change ArmResult to ArmReport --- .../Microsoft.Consumption/stable/2019-10-01/consumption.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json index 82a760310acb..68a97d96468b 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json @@ -1509,7 +1509,7 @@ "202": { "description": "OK. Accepted.", "schema": { - "$ref": "#/definitions/ArmResult" + "$ref": "#/definitions/ArmReport" } }, "default": { From eb3aa7defebe269883fd1e69179287f7657b7869 Mon Sep 17 00:00:00 2001 From: Alex Goldschmidt Date: Mon, 4 Apr 2022 17:51:31 -0400 Subject: [PATCH 4/6] Fix example format --- .../stable/2019-10-01/consumption.json | 65 +++++++++++++++---- 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json index 68a97d96468b..5e9280e1cac5 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json @@ -308,9 +308,24 @@ ], "responses": { "202": { - "description": "OK. Accepted.", - "schema": { - "$ref": "#/definitions/ArmReport" + "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" + }, + "Azure-AsyncOperation": { + "description": "To get the progress of the operation, call GET operation on the URL in Azure-AsyncOperation header field.", + "type": "string" + }, + "OData-EntityId": { + "description": "The operation entity Id GUID.", + "type": "string" + } } }, "default": { @@ -754,10 +769,24 @@ ], "responses": { "202": { - "description": "OK. Accepted.", - "schema": { - "$ref": "#/definitions/ArmReport" - } + "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" + }, + "Azure-AsyncOperation": { + "description": "To get the progress of the operation, call GET operation on the URL in Azure-AsyncOperation header field.", + "type": "string" + }, + "OData-EntityId": { + "description": "The operation entity Id GUID.", + "type": "string" + } }, "default": { "description": "Error response describing why the operation failed.", @@ -1507,10 +1536,24 @@ ], "responses": { "202": { - "description": "OK. Accepted.", - "schema": { - "$ref": "#/definitions/ArmReport" - } + "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" + }, + "Azure-AsyncOperation": { + "description": "To get the progress of the operation, call GET operation on the URL in Azure-AsyncOperation header field.", + "type": "string" + }, + "OData-EntityId": { + "description": "The operation entity Id GUID.", + "type": "string" + } }, "default": { "description": "Error response describing why the operation failed.", From 253f4bd682b0a82d25b0a32ada780f03d3eabdfa Mon Sep 17 00:00:00 2001 From: Alex Goldschmidt Date: Mon, 4 Apr 2022 18:00:17 -0400 Subject: [PATCH 5/6] Add missing curly brace --- .../Microsoft.Consumption/stable/2019-10-01/consumption.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json index 5e9280e1cac5..d7e054aa5582 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json @@ -787,6 +787,7 @@ "description": "The operation entity Id GUID.", "type": "string" } + } }, "default": { "description": "Error response describing why the operation failed.", From c3c30786aee07f72a2f19b2eb6bbd89aa8b94fd1 Mon Sep 17 00:00:00 2001 From: Alex Goldschmidt Date: Tue, 5 Apr 2022 11:18:52 -0400 Subject: [PATCH 6/6] Missing another curly brace --- .../Microsoft.Consumption/stable/2019-10-01/consumption.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json index d7e054aa5582..4d16abcd8b77 100644 --- a/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json +++ b/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-10-01/consumption.json @@ -1555,6 +1555,7 @@ "description": "The operation entity Id GUID.", "type": "string" } + } }, "default": { "description": "Error response describing why the operation failed.",