diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/costmanagement.json index 073b751da189..4bcc2b99794a 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/costmanagement.json @@ -1146,6 +1146,57 @@ } } }, + "/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}/Forecast": { + "post": { + "tags": [ + "Forecast" + ], + "operationId": "Forecast_UsageByExternalBillingAccount", + "description": "Forecast the usage data for external billing account.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ExternalBillingAccountForecast": { + "$ref": "./examples/ExternalBillingAccountForecast.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalBillingAccountNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfigDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, "/providers/Microsoft.CostManagement/cloudConnectors": { "get": { "tags": [ @@ -1775,7 +1826,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ShowbackRuleProperties" + "$ref": "#/definitions/ShowbackRule" }, "description": "Showback rule to create or update." } @@ -2846,8 +2897,11 @@ } }, "ShowbackRuleProperties": { + "required": [ + "ruleType" + ], "description": "The properties of a showback rule.", - "discriminator": "RuleType", + "discriminator": "ruleType", "properties": { "description": { "description": "Description of a showback rule.", @@ -2894,32 +2948,69 @@ "format": "date-time", "type": "string", "readOnly": true + }, + "ruleType": { + "type": "string", + "description": "The rule type of the showback rule solution.", + "enum": [ + "CustomPrice", + "CostAllocation" + ], + "x-ms-enum": { + "name": "RuleType", + "modelAsString": true + } } - }, - "allOf": [ - { - "$ref": "#/definitions/ShowbackRulesKind" + } + }, + "Scope": { + "type": "object", + "description": "The Scope model definition", + "properties": { + "id": { + "type": "string", + "description": "Scope id" + }, + "name": { + "type": "string", + "description": "Scope name" + }, + "type": { + "type": "string", + "description": "Scope type" + }, + "childScope": { + "$ref": "#/definitions/Scope" } - ] + } }, - "CustomPrice": { - "x-ms-discriminator-value": "CustomPrice", + "Markup": { "type": "object", - "description": "Represents Custom price showback rule model", + "description": "The Markup model definition", + "properties": { + "percentage": { + "type": "string" + } + } + }, + "CustomPriceDetailsKind": { + "properties": { + "details": { + "x-ms-client-flatten": true, + "description": "The Custom price properties to validate.", + "$ref": "#/definitions/CustomPriceDetails" + } + }, "allOf": [ { "$ref": "#/definitions/ShowbackRuleProperties" } ], - "properties": { - "details": { - "$ref": "#/definitions/CustomPriceProperties" - } - } + "description": "Represents Custom price showback rule model", + "x-ms-discriminator-value": "CustomPrice" }, - "CustomPriceProperties": { - "type": "object", - "title": "Custom price showback rule properties", + "CustomPriceDetails": { + "description": "Represents Custom price showback rule model", "properties": { "pricesheet": { "type": "string" @@ -2950,122 +3041,39 @@ } } }, - "CustomCharge": { - "x-ms-discriminator-value": "CustomCharge", - "type": "object", - "description": "Represents custom charge showback rule model", - "allOf": [ - { - "$ref": "#/definitions/ShowbackRuleProperties" - } - ], + "CostAllocationDetailsKind": { "properties": { "details": { - "$ref": "#/definitions/CustomChargeProperties" - } - } - }, - "CustomChargeProperties": { - "type": "object", - "title": "Custom charge showback rule properties", - "properties": { - "recurring": { - "description": "Recurring of the charge.", - "type": "string", - "readOnly": true, - "enum": [ - "true", - "false" - ], - "x-ms-enum": { - "name": "CustomChargeRecurring", - "modelAsString": true - } - }, - "chargeType": { - "type": "string" - }, - "ChargeValue": { - "type": "string" - }, - "EffectiveMonth": { - "format": "date-time", - "type": "string" - }, - "EndMonth": { - "format": "date-time", - "type": "string" + "x-ms-client-flatten": true, + "description": "The CostAllocation properties to validate.", + "$ref": "#/definitions/CostAllocationDetails" } - } - }, - "CostAllocation": { - "x-ms-discriminator-value": "CostAllocation", - "type": "object", - "description": "Represents cost allocation showback rule model", + }, "allOf": [ { "$ref": "#/definitions/ShowbackRuleProperties" } ], - "properties": { - "details": { - "$ref": "#/definitions/CostAllocationProperties" - } - } - }, - "CostAllocationProperties": { - "type": "object", - "title": "Cost allocation showback rule properties", - "properties": {} + "description": "Represents CostAllocation showback rule model", + "x-ms-discriminator-value": "CostAllocation" }, - "ShowbackRulesKind": { - "type": "object", - "description": "Describes Showback rule with rule type", + "CostAllocationDetails": { + "description": "Represents CostAllocation showback rule model", "properties": { - "RuleType": { + "policy": { + "description": "Cost allocation policy.", "type": "string", - "description": "The rule type of the showback rule solution", "enum": [ - "CustomPrice", - "CustomChange", - "CostAllocation" + "Proportional", + "Evenly", + "Fixed" ], "x-ms-enum": { - "name": "ShowbackRulesKind", + "name": "CostAllocationPolicy", "modelAsString": true } } } - }, - "Scope": { - "type": "object", - "description": "The Scope model definition", - "properties": { - "id": { - "type": "string", - "description": "Scope id" - }, - "name": { - "type": "string", - "description": "Scope name" - }, - "type": { - "type": "string", - "description": "Scope type" - }, - "childScope": { - "$ref": "#/definitions/Scope" - } - } - }, - "Markup": { - "type": "object", - "description": "The Markup model definition", - "properties": { - "percentage": { - "type": "string" - } - } } }, "parameters": { diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ExternalBillingAccountForecast.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ExternalBillingAccountForecast.json new file mode 100644 index 000000000000..1d863cba74b1 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ExternalBillingAccountForecast.json @@ -0,0 +1,128 @@ +{ + "parameters": { + "api-version": "2019-03-01-preview", + "externalBillingAccountName": "aws-123456789012", + "parameters": { + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2018-08-01T00:00:00.000Z", + "to": "2018-10-31T00:00:00.000Z" + }, + "dataset": { + "granularity": "Daily", + "filter": { + "and": [ + { + "or": [ + { + "dimension": { + "name": "SubscriptionName", + "operator": "In", + "values": [ + "Azure Dev", + "Azure Prod", + "Azure PPE" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "Dev", + "PPE", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "DepartmentName", + "operator": "In", + "values": [ + "Azure Dept" + ] + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.CostManagement/externalBillingAccounts/aws-123456789012/Forecast/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "Microsoft.CostManagement/forecast", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "UsageDate", + "type": "Number" + }, + { + "name": "CostStatus", + "type": "String" + }, + { + "name": "Currency", + "type": "String" + } + ], + "rows": [ + [ + 19.545363672276512, + 20180831, + "Actual", + "USD" + ], + [ + 20.41979233490323, + 20180930, + "Actual", + "USD" + ], + [ + 21.322216562625452, + 20181031, + "Actual", + "USD" + ], + [ + 22.545363672276532, + 20180831, + "Actual", + "USD" + ], + [ + 23.41979675590323, + 20180930, + "Forecast", + "USD" + ], + [ + 24.359416562626652, + 20181031, + "Forecast", + "USD" + ] + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRuleGet.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRuleGet.json index fe7a61a41bb8..2058b3f25843 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRuleGet.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRuleGet.json @@ -10,20 +10,19 @@ "id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/showbackRules/testRule", "name": "testRule", "type": "Microsoft.CostManagement/showbackRules", - "eTag": null, "properties": { "description": "This is a testRule", "status": "NotActive", "version": 1, - "deprecationTime": "0001-01-01T00:00:00", + "deprecationTime": "2019-03-16T09:18:20.8665509Z", "creationTime": "2019-01-16T09:18:20.8665509Z", - "modificationTime": "0001-01-01T00:00:00", + "modificationTime": "2019-01-17T09:18:20.8665509Z", "ruleType": "CustomPrice", - "assignedScopes": null, + "scopes": null, "details": { "pricesheet": "Pay-As-You-Go (0003P)", - "AHUBenefits": true, - "markup": null + "benefits": ["None"], + "markups": null } } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulePut.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulePut.json index ae9077ae57c2..581897274dd9 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulePut.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulePut.json @@ -4,25 +4,24 @@ "billingAccountId": "100", "ruleName": "testRule", "showbackRule": { + "name": "demo", "properties": { - "name": "demo", "description": "Welcome to Showback demo", "status": "Active", "ruleType": "CustomPrice", - "assignedScopes": [ + "scopes": [ { - "entityType": "Enrollment", - "entityId": "292105a9-680d-48cf-bdad-1d023104d69f", + "type": "Enrollment", + "id": "292105a9-680d-48cf-bdad-1d023104d69f", "childScope": null } ], "details": { "pricesheet": "Pay-As-You-Go (0003P)", - "AHUBenefits": true, - "markup": [ + "benefits": ["None"], + "markups": [ { - "percentage": 1.1, - "filters": [] + "percentage": "1.1" } ] } @@ -35,22 +34,21 @@ "id": "providers/Microsoft.Billing/billingAccounts/71824150/providers/Microsoft.CostManagement/showbackRules/demo", "name": "demo", "type": "Microsoft.CostManagement/showbackRules", - "eTag": null, "properties": { "version": 999, - "deprecationTime": "0001-01-01T00:00:00", + "deprecationTime": "2019-03-16T09:18:20.8665509Z", "creationTime": "2019-01-16T09:18:20.8665509Z", - "modificationTime": "0001-01-01T00:00:00", + "modificationTime": "2019-01-17T09:18:20.8665509Z", "description": "Welcome to Showback demo", "status": "NotActive", "ruleType": "CustomPrice", + "scopes": null, "details": { "pricesheet": "Pay-As-You-Go (0003P)", - "AHUBenefits": true, - "markup": [ + "benefits": ["None"], + "markups": [ { - "percentage": 1.1, - "filters": [] + "percentage": "1.1" } ] } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulesList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulesList.json index 252190d2c08b..83e5a5a5dd22 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulesList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2019-03-01-preview/examples/ShowbackRulesList.json @@ -11,20 +11,19 @@ "id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/showbackRules/testRule", "name": "testRule", "type": "Microsoft.CostManagement/showbackRules", - "eTag": null, "properties": { "description": "This is a testRule", "status": "NotActive", "version": 1, - "deprecationTime": "0001-01-01T00:00:00", + "deprecationTime": "2019-03-16T09:18:20.8665509Z", "creationTime": "2019-01-16T09:18:20.8665509Z", - "modificationTime": "0001-01-01T00:00:00", + "modificationTime": "2019-01-17T09:18:20.8665509Z", "ruleType": "CustomPrice", - "assignedScopes": null, + "scopes": null, "details": { "pricesheet": "Pay-As-You-Go (0003P)", - "AHUBenefits": true, - "markup": null + "benefits": ["None"], + "markups": null } } } diff --git a/specification/cost-management/resource-manager/readme.go.md b/specification/cost-management/resource-manager/readme.go.md index 5402662fe5fe..65727348911d 100644 --- a/specification/cost-management/resource-manager/readme.go.md +++ b/specification/cost-management/resource-manager/readme.go.md @@ -15,6 +15,7 @@ batch: - tag: package-2018-05 - tag: package-2018-08-preview - tag: package-2019-01 + - tag: package-preview-2019-03 ``` ### Tag: package-2018-05 and go @@ -40,3 +41,11 @@ Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-preview-2019-03' && $(go) +output-folder: $(go-sdk-folder)/services/preview/$(namespace)/mgmt/2019-03-01/$(namespace) +``` diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 9be7e6389925..9ae7fe719dbe 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -36,18 +36,20 @@ azure-validator: true These settings apply only when `--tag=package-2019-01` is specified on the command line. -```yaml $(tag) == 'package-2019-01' +``` yaml $(tag) == 'package-2019-01' input-file: - Microsoft.CostManagement/stable/2019-01-01/costmanagement.json ``` + ### Tag: package-preview-2019-03 These settings apply only when `--tag=package-preview-2019-03` is specified on the command line. -```yaml $(tag) == 'package-preview-2019-03' +``` yaml $(tag) == 'package-preview-2019-03' input-file: - Microsoft.CostManagement/preview/2019-03-01-preview/costmanagement.json ``` + ### Tag: package-2018-05 These settings apply only when `--tag=package-2018-05` is specified on the command line. @@ -69,6 +71,26 @@ directive: from: costmanagement.json where: $.paths reason: operations API for Microsoft.Billing are defined in Microsoft.Billing + - suppress: XmsResourceInPutResponse + from: costmanagement.json + where: '$.paths["/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/showbackRules/{ruleName}"].put' + reason: 'older PR, not forecast.' + - suppress: DefinitionsPropertiesNamesCamelCase + from: costmanagement.json + where: $.definitions.CustomChargeProperties.properties.ChargeValue + reason: 'older PR, not forecast.' + - suppress: DefinitionsPropertiesNamesCamelCase + from: costmanagement.json + where: $.definitions.CustomChargeProperties.properties.EffectiveMonth + reason: 'older PR, not forecast.' + - suppress: DefinitionsPropertiesNamesCamelCase + from: costmanagement.json + where: $.definitions.CustomChargeProperties.properties.EndMonth + reason: 'older PR, not forecast.' + - suppress: DefinitionsPropertiesNamesCamelCase + from: costmanagement.json + where: $.definitions.ShowbackRulesKind.properties.RuleType + reason: 'older PR, not forecast.' ``` ### Tag: package-2018-08-preview