From 60e65346128e540d512e981b29478fd557c797ab Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Date: Wed, 24 Aug 2022 22:11:41 -0700 Subject: [PATCH 1/7] Initial Change --- .../stable/2021-10-01/costmanagement.json | 277 +++++++++++++++--- .../examples/BillingAccountForecast.json | 214 +++++++------- .../examples/BillingProfileForecast.json | 216 +++++++------- .../examples/DepartmentForecast.json | 216 +++++++------- .../examples/EnrollmentAccountForecast.json | 12 +- .../examples/InvoiceSectionForecast.json | 218 +++++++------- .../examples/ResourceGroupForecast.json | 180 ++++++------ .../examples/SubscriptionForecast.json | 214 +++++++------- 8 files changed, 901 insertions(+), 646 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json index 5b4e808ef880..adabdab51ef1 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json @@ -639,7 +639,7 @@ "200": { "description": "OK. The request has succeeded.", "schema": { - "$ref": "#/definitions/QueryResult" + "$ref": "#/definitions/ForecastResult" } }, "204": { @@ -703,7 +703,7 @@ "200": { "description": "OK. The request has succeeded.", "schema": { - "$ref": "#/definitions/QueryResult" + "$ref": "#/definitions/ForecastResult" } }, "default": { @@ -2184,6 +2184,66 @@ } } }, + "ForecastResult": { + "description": "Result of forecast. It contains all columns listed under groupings and aggregation.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ForecastProperties", + "title": "Forecast properties" + } + } + }, + "ForecastProperties": { + "description": "Forecast properties", + "type": "object", + "properties": { + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string" + }, + "columns": { + "description": "Array of columns", + "type": "array", + "items": { + "$ref": "#/definitions/ForecastColumn" + }, + "x-ms-identifiers": [ + "name" + ] + }, + "rows": { + "description": "Array of rows", + "type": "array", + "items": { + "type": "array", + "items": {}, + "x-ms-identifiers": [] + }, + "x-ms-identifiers": [] + } + } + }, + "ForecastColumn": { + "description": "Forecast column properties", + "type": "object", + "properties": { + "name": { + "description": "The name of column.", + "type": "string" + }, + "type": { + "description": "The type of column.", + "type": "string" + } + } + }, "QueryResult": { "description": "Result of query. It contains all columns listed under groupings and aggregation.", "type": "object", @@ -2311,54 +2371,74 @@ "properties": { "type": { "description": "The type of the forecast.", - "type": "string", - "enum": [ - "Usage", - "ActualCost", - "AmortizedCost" - ], - "x-ms-enum": { - "name": "ForecastType", - "modelAsString": true - } + "type":"string", + "$ref": "#/definitions/ForecastType" }, "timeframe": { - "description": "The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.", - "type": "string", - "enum": [ - "MonthToDate", - "BillingMonthToDate", - "TheLastMonth", - "TheLastBillingMonth", - "WeekToDate", - "Custom" - ], - "x-ms-enum": { - "name": "ForecastTimeframeType", - "modelAsString": true - } + "description": "The time frame for pulling data for the forecast.", + "type":"string", + "$ref": "#/definitions/ForecastTimeframe" }, "timePeriod": { "description": "Has time period for pulling data for the forecast.", - "$ref": "#/definitions/QueryTimePeriod" + "type":"object", + "$ref": "#/definitions/ForecastTimePeriod" }, "dataset": { "description": "Has definition for data in this forecast.", + "type":"object", "$ref": "#/definitions/ForecastDataset" }, "includeActualCost": { - "description": "a boolean determining if actualCost will be included", + "description": "A boolean determining if actualCost will be included.", "type": "boolean" }, "includeFreshPartialCost": { - "description": "a boolean determining if FreshPartialCost will be included", + "description": "A boolean determining if FreshPartialCost will be included.", "type": "boolean" } }, "required": [ "type", "timeframe", - "dataset" + "dataset", + "timePeriod" + ] + }, + "ForecastType": { + "description": "The type of the forecast.", + "type": "string", + "enum": [ + "Usage", + "ActualCost", + "AmortizedCost" + ] + }, + "ForecastTimeframe": { + "description": "The time frame for pulling data for the forecast.", + "type": "string", + "enum": [ + "Custom" + ] + }, + "ForecastTimePeriod": { + "description": "Has time period for pulling data for the forecast.", + "type": "object", + "properties": { + "from": { + "description": "The start date to pull data from.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date to pull data to.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from", + "to" ] }, "ForecastDataset": { @@ -2367,35 +2447,140 @@ "properties": { "granularity": { "description": "The granularity of rows in the forecast.", - "type": "string", - "enum": [ - "Daily" - ], - "x-ms-enum": { - "name": "GranularityType", - "modelAsString": true - } + "type":"string", + "$ref": "#/definitions/GranularityType" }, "configuration": { "description": "Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.", - "$ref": "#/definitions/QueryDatasetConfiguration" + "$ref": "#/definitions/ForecastDatasetConfiguration" }, "aggregation": { - "type": "object", "description": "Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses.", - "additionalProperties": { - "type": "object", - "$ref": "#/definitions/QueryAggregation" - }, + "type": "object", + "$ref": "#/definitions/ForecastAggregation", "maxItems": 2 }, "filter": { - "type": "object", "description": "Has filter expression to use in the forecast.", - "$ref": "#/definitions/QueryFilter" + "type": "object", + "$ref": "#/definitions/ForecastFilter" + } + }, + "required": [ + "aggregation" + ] + }, + "GranularityType":{ + "description": "The granularity of rows in the forecast.", + "type":"string", + "enum": [ + "Daily" + ] + }, + "ForecastDatasetConfiguration": { + "description": "The configuration of dataset in the forecast.", + "type": "object", + "properties": { + "columns": { + "description": "Array of column names to be included in the forecast. Any valid forecast column name is allowed. If not provided, then forecast includes all columns.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ForecastAggregation": { + "description": "The aggregation expression to be used in the forecast.", + "type": "object", + "properties": { + "name": { + "description": "The name of the column to aggregate.", + "type": "string" + }, + "function": { + "description": "The name of the aggregation function to use.", + "type": "string", + "enum": [ + "Sum" + ], + "x-ms-enum": { + "name": "FunctionType", + "modelAsString": true + } + } + }, + "required": [ + "name", + "function" + ] + }, + "ForecastFilter": { + "description": "The filter expression to be used in the export.", + "type": "object", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ForecastFilter" + }, + "x-ms-identifiers": [], + "minItems": 2 + }, + "or": { + "description": "The logical \"OR\" expression. Must have at least 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ForecastFilter" + }, + "x-ms-identifiers": [], + "minItems": 2 + }, + "dimensions": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/ForecastComparisonExpression" + }, + "tags": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/ForecastComparisonExpression" } } }, + "ForecastComparisonExpression": { + "description": "The comparison expression to be used in the forecast.", + "type": "object", + "properties": { + "name": { + "description": "The name of the column to use in comparison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", + "type": "string", + "enum": [ + "In" + ], + "x-ms-enum": { + "name": "QueryOperatorType", + "modelAsString": true + } + }, + "values": { + "description": "Array of values to use for comparison", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, "QueryDefinition": { "description": "The definition of a query.", "type": "object", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json index c930b012cc6c..348785867ffc 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json @@ -1,110 +1,120 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789", - "parameters": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] } - } - ] - } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json index 967338b46cd4..eca492049c38 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json @@ -1,111 +1,121 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "billingProfileId": "13579", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", - "parameters": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "billingProfileId": "13579", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] } - } - ] - } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json index 23c5074f3e0c..3f7913daaf9f 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json @@ -1,111 +1,121 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "departmentId": "123", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", - "parameters": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "departmentId": "123", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] } - } - ] - } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json index 093ec2218244..33280f201332 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json @@ -6,9 +6,19 @@ "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456", "parameters": { "type": "Usage", - "timeframe": "MonthToDate", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, "dataset": { "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, "filter": { "and": [ { diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json index 2b2bf5ee04c8..013caaed25a1 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json @@ -1,112 +1,122 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "billingProfileId": "13579", - "invoiceSectionId": "9876", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", - "parameters": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "billingProfileId": "13579", + "invoiceSectionId": "9876", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] } - } - ] - } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json index 20fd7ba2f22e..7c1be085b120 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json @@ -1,93 +1,103 @@ { "parameters": { - "api-version": "2021-10-01", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroupName": "ScreenSharingTest-peer", - "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", - "parameters": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "ScreenSharingTest-peer", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] } - } - ] - } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", - "name": "55312978-ba1b-415c-9304-cfd9c43c0481", - "type": "microsoft.costmanagement/Query", - "properties": { - "nextLink": null, - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", + "name": "55312978-ba1b-415c-9304-cfd9c43c0481", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json index 47679e6bcdf7..0faf8b8cf485 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json @@ -1,110 +1,120 @@ { "parameters": { - "api-version": "2021-10-01", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "scope": "subscriptions/00000000-0000-0000-0000-000000000000", - "parameters": { - "type": "Usage", - "timeframe": "MonthToDate", - "dataset": { - "granularity": "Daily", - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] } - } - ] - } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", - "name": "55312978-ba1b-415c-9304-cfd9c43c0481", - "type": "microsoft.costmanagement/Query", - "properties": { - "nextLink": null, - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", + "name": "55312978-ba1b-415c-9304-cfd9c43c0481", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } From e691b10d76705e529becd769e91de728ae76745e Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Date: Wed, 24 Aug 2022 22:44:17 -0700 Subject: [PATCH 2/7] Added enum property --- .../stable/2021-10-01/costmanagement.json | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json index adabdab51ef1..924b43b0abc1 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json @@ -2496,7 +2496,17 @@ "properties": { "name": { "description": "The name of the column to aggregate.", - "type": "string" + "type": "string", + "enum": [ + "PreTaxCostUSD", + "Cost", + "CostUSD", + "PreTaxCost" + ], + "x-ms-enum": { + "name": "FunctionName", + "modelAsString": true + } }, "function": { "description": "The name of the aggregation function to use.", @@ -2562,7 +2572,7 @@ "In" ], "x-ms-enum": { - "name": "QueryOperatorType", + "name": "ForecastOperatorType", "modelAsString": true } }, From 9f84c50ca2dc674ae9d831a4d4cd9f2b43df2fcd Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Date: Wed, 24 Aug 2022 22:59:54 -0700 Subject: [PATCH 3/7] Fixed example files --- .../stable/2021-10-01/examples/BillingAccountForecast.json | 2 +- .../stable/2021-10-01/examples/BillingProfileForecast.json | 2 +- .../stable/2021-10-01/examples/DepartmentForecast.json | 2 +- .../stable/2021-10-01/examples/EnrollmentAccountForecast.json | 2 +- .../stable/2021-10-01/examples/InvoiceSectionForecast.json | 2 +- .../stable/2021-10-01/examples/ResourceGroupForecast.json | 2 +- .../stable/2021-10-01/examples/SubscriptionForecast.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json index 348785867ffc..ec8f9dc96501 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json @@ -65,7 +65,7 @@ "body": { "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", + "type": "Microsoft.CostManagement/query", "properties": { "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", "columns": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json index eca492049c38..1a699c96b913 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json @@ -66,7 +66,7 @@ "body": { "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", + "type": "Microsoft.CostManagement/query", "properties": { "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", "columns": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json index 3f7913daaf9f..210d079fdf55 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json @@ -66,7 +66,7 @@ "body": { "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", + "type": "Microsoft.CostManagement/query", "properties": { "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", "columns": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json index 33280f201332..791d57caa678 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json @@ -66,7 +66,7 @@ "body": { "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", + "type": "Microsoft.CostManagement/query", "properties": { "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/enrollmentAccounts/456/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", "columns": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json index 013caaed25a1..893673640b10 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json @@ -67,7 +67,7 @@ "body": { "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "microsoft.costmanagement/Query", + "type": "Microsoft.CostManagement/query", "properties": { "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", "columns": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json index 7c1be085b120..cf67996eddd5 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json @@ -66,7 +66,7 @@ "body": { "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", "name": "55312978-ba1b-415c-9304-cfd9c43c0481", - "type": "microsoft.costmanagement/Query", + "type": "Microsoft.CostManagement/query", "properties": { "nextLink": null, "columns": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json index 0faf8b8cf485..76ff6c3504dc 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json @@ -65,7 +65,7 @@ "body": { "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", "name": "55312978-ba1b-415c-9304-cfd9c43c0481", - "type": "microsoft.costmanagement/Query", + "type": "Microsoft.CostManagement/query", "properties": { "nextLink": null, "columns": [ From c9719fb20cb5eca421cbfc42550740dee3adf534 Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Date: Wed, 24 Aug 2022 23:20:19 -0700 Subject: [PATCH 4/7] Re-added property --- .../stable/2021-10-01/costmanagement.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json index 924b43b0abc1..798c607b638f 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json @@ -2457,7 +2457,10 @@ "aggregation": { "description": "Dictionary of aggregation expression to use in the forecast. The key of each item in the dictionary is the alias for the aggregated column. forecast can have up to 2 aggregation clauses.", "type": "object", - "$ref": "#/definitions/ForecastAggregation", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/ForecastAggregation" + }, "maxItems": 2 }, "filter": { From 39ecdd477e79d0a649111d1cb30d06e452fe4616 Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Date: Wed, 24 Aug 2022 23:34:45 -0700 Subject: [PATCH 5/7] Added x-ms-enum to enums --- .../stable/2021-10-01/costmanagement.json | 18 +++++++++++++++--- .../ExternalBillingAccountForecast.json | 12 +++++++++++- .../examples/ExternalSubscriptionForecast.json | 12 +++++++++++- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json index 798c607b638f..91c3ff0b6f2f 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json @@ -2412,14 +2412,22 @@ "Usage", "ActualCost", "AmortizedCost" - ] + ], + "x-ms-enum": { + "name": "ForecastType", + "modelAsString": true + } }, "ForecastTimeframe": { "description": "The time frame for pulling data for the forecast.", "type": "string", "enum": [ "Custom" - ] + ], + "x-ms-enum": { + "name": "ForecastTimeframe", + "modelAsString": true + } }, "ForecastTimePeriod": { "description": "Has time period for pulling data for the forecast.", @@ -2478,7 +2486,11 @@ "type":"string", "enum": [ "Daily" - ] + ], + "x-ms-enum": { + "name": "GranularityType", + "modelAsString": true + } }, "ForecastDatasetConfiguration": { "description": "The configuration of dataset in the forecast.", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountForecast.json index 167367d188ab..41840ee7d022 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalBillingAccountForecast.json @@ -5,9 +5,19 @@ "externalCloudProviderType": "externalBillingAccounts", "parameters": { "type": "Usage", - "timeframe": "MonthToDate", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, "dataset": { "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, "filter": { "and": [ { diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalSubscriptionForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalSubscriptionForecast.json index f651e5cec87a..90177d816e10 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalSubscriptionForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ExternalSubscriptionForecast.json @@ -5,9 +5,19 @@ "externalCloudProviderType": "externalSubscriptions", "parameters": { "type": "Usage", - "timeframe": "MonthToDate", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, "dataset": { "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, "filter": { "and": [ { From 544667cc2e5f1429fc621a9991d748092edbd095 Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Date: Wed, 24 Aug 2022 23:57:23 -0700 Subject: [PATCH 6/7] Ran prettier --- .../stable/2021-10-01/costmanagement.json | 14 +- .../examples/BillingAccountForecast.json | 224 ++++++++--------- .../examples/BillingProfileForecast.json | 226 ++++++++--------- .../examples/DepartmentForecast.json | 226 ++++++++--------- .../examples/EnrollmentAccountForecast.json | 6 +- .../examples/InvoiceSectionForecast.json | 228 +++++++++--------- .../examples/ResourceGroupForecast.json | 190 +++++++-------- .../examples/SubscriptionForecast.json | 224 ++++++++--------- 8 files changed, 669 insertions(+), 669 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json index 91c3ff0b6f2f..8c443d0fd90b 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json @@ -2371,22 +2371,22 @@ "properties": { "type": { "description": "The type of the forecast.", - "type":"string", + "type": "string", "$ref": "#/definitions/ForecastType" }, "timeframe": { "description": "The time frame for pulling data for the forecast.", - "type":"string", + "type": "string", "$ref": "#/definitions/ForecastTimeframe" }, "timePeriod": { "description": "Has time period for pulling data for the forecast.", - "type":"object", + "type": "object", "$ref": "#/definitions/ForecastTimePeriod" }, "dataset": { "description": "Has definition for data in this forecast.", - "type":"object", + "type": "object", "$ref": "#/definitions/ForecastDataset" }, "includeActualCost": { @@ -2455,7 +2455,7 @@ "properties": { "granularity": { "description": "The granularity of rows in the forecast.", - "type":"string", + "type": "string", "$ref": "#/definitions/GranularityType" }, "configuration": { @@ -2481,9 +2481,9 @@ "aggregation" ] }, - "GranularityType":{ + "GranularityType": { "description": "The granularity of rows in the forecast.", - "type":"string", + "type": "string", "enum": [ "Daily" ], diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json index ec8f9dc96501..74b927c8f9f8 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingAccountForecast.json @@ -1,120 +1,120 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789", - "parameters": { - "type": "Usage", - "timeframe": "Custom", - "timePeriod": { - "from": "2022-08-01T00:00:00+00:00", - "to": "2022-08-31T23:59:59+00:00" - }, - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "Cost", - "function": "Sum" + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] } - }, - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] - } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] - } - } - ] + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + } + ] + } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "Microsoft.CostManagement/query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "Microsoft.CostManagement/query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json index 1a699c96b913..e2d7f70d0b0d 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/BillingProfileForecast.json @@ -1,121 +1,121 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "billingProfileId": "13579", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", - "parameters": { - "type": "Usage", - "timeframe": "Custom", - "timePeriod": { - "from": "2022-08-01T00:00:00+00:00", - "to": "2022-08-31T23:59:59+00:00" - }, - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "Cost", - "function": "Sum" + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "billingProfileId": "13579", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] } - }, - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] - } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] - } - } - ] + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + } + ] + } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "Microsoft.CostManagement/query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "Microsoft.CostManagement/query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json index 210d079fdf55..ae9958656167 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/DepartmentForecast.json @@ -1,121 +1,121 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "departmentId": "123", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", - "parameters": { - "type": "Usage", - "timeframe": "Custom", - "timePeriod": { - "from": "2022-08-01T00:00:00+00:00", - "to": "2022-08-31T23:59:59+00:00" - }, - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "Cost", - "function": "Sum" + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "departmentId": "123", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] } - }, - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] - } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] - } - } - ] + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + } + ] + } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "Microsoft.CostManagement/query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "Microsoft.CostManagement/query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/departments/123/providers/Microsoft.CostManagement/Forecast?api-version=2021-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json index 791d57caa678..6d14db0dedef 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/EnrollmentAccountForecast.json @@ -15,10 +15,10 @@ "granularity": "Daily", "aggregation": { "totalCost": { - "name": "Cost", - "function": "Sum" + "name": "Cost", + "function": "Sum" } - }, + }, "filter": { "and": [ { diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json index 893673640b10..bbb6d54fc64c 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/InvoiceSectionForecast.json @@ -1,122 +1,122 @@ { "parameters": { - "api-version": "2021-10-01", - "billingAccountId": "12345:6789", - "billingProfileId": "13579", - "invoiceSectionId": "9876", - "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", - "parameters": { - "type": "Usage", - "timeframe": "Custom", - "timePeriod": { - "from": "2022-08-01T00:00:00+00:00", - "to": "2022-08-31T23:59:59+00:00" - }, - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "Cost", - "function": "Sum" + "api-version": "2021-10-01", + "billingAccountId": "12345:6789", + "billingProfileId": "13579", + "invoiceSectionId": "9876", + "scope": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] } - }, - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] - } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] - } - } - ] + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + } + ] + } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", - "type": "Microsoft.CostManagement/query", - "properties": { - "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "Microsoft.CostManagement/query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12345:6789/billingProfiles/13579/invoiceSections/9876/providers/Microsoft.CostManagement/Forecast?api-version=2019-10-01&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json index cf67996eddd5..5118cefc5126 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/ResourceGroupForecast.json @@ -1,103 +1,103 @@ { "parameters": { - "api-version": "2021-10-01", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "resourceGroupName": "ScreenSharingTest-peer", - "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", - "parameters": { - "type": "Usage", - "timeframe": "Custom", - "timePeriod": { - "from": "2022-08-01T00:00:00+00:00", - "to": "2022-08-31T23:59:59+00:00" - }, - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "Cost", - "function": "Sum" + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "ScreenSharingTest-peer", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] } - }, - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] - } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] - } - } - ] + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + } + ] + } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", - "name": "55312978-ba1b-415c-9304-cfd9c43c0481", - "type": "Microsoft.CostManagement/query", - "properties": { - "nextLink": null, - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", + "name": "55312978-ba1b-415c-9304-cfd9c43c0481", + "type": "Microsoft.CostManagement/query", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json index 76ff6c3504dc..94fd2e3fc230 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/examples/SubscriptionForecast.json @@ -1,120 +1,120 @@ { "parameters": { - "api-version": "2021-10-01", - "subscriptionId": "00000000-0000-0000-0000-000000000000", - "scope": "subscriptions/00000000-0000-0000-0000-000000000000", - "parameters": { - "type": "Usage", - "timeframe": "Custom", - "timePeriod": { - "from": "2022-08-01T00:00:00+00:00", - "to": "2022-08-31T23:59:59+00:00" - }, - "dataset": { - "granularity": "Daily", - "aggregation": { - "totalCost": { - "name": "Cost", - "function": "Sum" + "api-version": "2021-10-01", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2022-08-01T00:00:00+00:00", + "to": "2022-08-31T23:59:59+00:00" + }, + "dataset": { + "granularity": "Daily", + "aggregation": { + "totalCost": { + "name": "Cost", + "function": "Sum" + } + }, + "filter": { + "and": [ + { + "or": [ + { + "dimensions": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tags": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] } - }, - "filter": { - "and": [ - { - "or": [ - { - "dimensions": { - "name": "ResourceLocation", - "operator": "In", - "values": [ - "East US", - "West Europe" - ] - } - }, - { - "tags": { - "name": "Environment", - "operator": "In", - "values": [ - "UAT", - "Prod" - ] - } - } - ] - }, - { - "dimensions": { - "name": "ResourceGroup", - "operator": "In", - "values": [ - "API" - ] - } - } - ] + } + ] + }, + { + "dimensions": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] } - }, - "includeActualCost": false, - "includeFreshPartialCost": false - } + } + ] + } + }, + "includeActualCost": false, + "includeFreshPartialCost": false + } }, "responses": { - "200": { - "body": { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", - "name": "55312978-ba1b-415c-9304-cfd9c43c0481", - "type": "Microsoft.CostManagement/query", - "properties": { - "nextLink": null, - "columns": [ - { - "name": "PreTaxCost", - "type": "Number" - }, - { - "name": "UsageDate", - "type": "Number" - }, - { - "name": "CostStatus", - "type": "String" - }, - { - "name": "Currency", - "type": "String" - } - ], - "rows": [ - [ - 2.10333307059661, - 20180331, - "Forecast", - "USD" - ], - [ - 218.68795741935486, - 20180331, - "Forecast", - "USD" - ], - [ - 0.14384913581657052, - 20180401, - "Forecast", - "USD" - ], - [ - 0.009865586851323632, - 20180429, - "Forecast", - "USD" - ] - ] - } - } - }, - "204": {} + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/query/00000000-0000-0000-0000-000000000000", + "name": "55312978-ba1b-415c-9304-cfd9c43c0481", + "type": "Microsoft.CostManagement/query", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 2.10333307059661, + 20180331, + "Forecast", + "USD" + ], + [ + 218.68795741935486, + 20180331, + "Forecast", + "USD" + ], + [ + 0.14384913581657052, + 20180401, + "Forecast", + "USD" + ], + [ + 0.009865586851323632, + 20180429, + "Forecast", + "USD" + ] + ] + } + } + }, + "204": {} } } From e1414c17f89f57c5ba5cff7700a52d32544e42da Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Date: Thu, 25 Aug 2022 00:07:09 -0700 Subject: [PATCH 7/7] Removed non-required property --- .../stable/2021-10-01/costmanagement.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json index 8c443d0fd90b..c0715358c833 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2021-10-01/costmanagement.json @@ -2375,7 +2375,7 @@ "$ref": "#/definitions/ForecastType" }, "timeframe": { - "description": "The time frame for pulling data for the forecast.", + "description": "The time frame for pulling data for the forecast. If custom, then a specific time period must be provided.", "type": "string", "$ref": "#/definitions/ForecastTimeframe" }, @@ -2401,8 +2401,7 @@ "required": [ "type", "timeframe", - "dataset", - "timePeriod" + "dataset" ] }, "ForecastType": {