Skip to content

Commit

Permalink
[Hub Generated] Review request for Microsoft.CostManagement to add ve…
Browse files Browse the repository at this point in the history
…rsion preview/2020-03-01-preview (#10407)

* Adds base for updating Microsoft.CostManagement from version preview/2019-04-01-preview to version 2020-03-01-preview

* Updates readme

* Updates API version in new specs and examples

* Sync to private repo change set

* Fix warnings

* Fix example for string over boolean

* List operation id fix

* Implement changes from review

* Fix response types

* Only one tag

* Fix failures

* Fix operation Ids

* Just CostAllocation

* Percentage as number

* Revert to working version

* First wave of review changes

* ruleName in examples

* Percentage as number, example for tag

* ruleName in tag example

* Add nesting for list

* More changes

* Fix example name

* Update tags/summary setup

* Update based on review

* Complete changes for API review

* remove tags

* fix response model, restore tag

* Add 204 to example

* Remove actual next link until implemented

* Improve naming

* restore paging

* fixes found in review

* Reduce duplication of definition object

* camelcase checkname url

* Make one type limitation clearer

* Use enum descriptions

* Add created/updated date to response contract

* minor style fix

* Fix examples

* Improve messages

* Remove correlation id, run prettier

* Fix error format

* Rename new files to costallocation.
Include all existing resources in version

* Include additional json in readme

* Remove items that aren't changing versions

* Use 2020-06-01 to avoid lint errors

* Fix more object mismatches

* Match parameter descriptions

* Remove request/response differences

* Fix semantics

* Fix readonly setup

* Remove format from readonly field

* Fix capitalization
  • Loading branch information
zachraMSFT authored Aug 21, 2020
1 parent d6d4333 commit 7ac0082
Show file tree
Hide file tree
Showing 8 changed files with 992 additions and 2 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parameters": {
"api-version": "2020-03-01-preview",
"billingAccountId": "100",
"costAllocationRuleCheckNameAvailabilityRequest": {
"name": "testRule",
"type": "Microsoft.CostManagement/costAllocationRules"
}
},
"responses": {
"200": {
"body": {
"nameAvailable": false,
"reason": "AlreadyExists",
"message": "A cost allocation rule with name testRule is already present for the billing account 100. Please specify a differnt name."
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parameters": {
"api-version": "2020-03-01-preview",
"billingAccountId": "100",
"ruleName": "testRule",
"costAllocationRule": {
"properties": {
"description": "This is a testRule",
"status": "Active",
"details": {
"sourceResources": [
{
"resourceType": "Dimension",
"name": "ResourceGroupName",
"values": [
"sampleRG",
"secondRG"
]
}
],
"targetResources": [
{
"resourceType": "Dimension",
"policyType": "FixedProportion",
"name": "ResourceGroupName",
"values": [
{
"name": "destinationRG",
"percentage": 45
},
{
"name": "destinationRG2",
"percentage": 54
}
]
}
]
}
}
}
},
"responses": {
"200": {
"body": {
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
"name": "testRule",
"type": "Microsoft.CostManagement/costAllocationRules",
"properties": {
"description": "This is a testRule",
"createdDate": "2020-06-18T22:21:51.1287144Z",
"updatedDate": "2020-06-18T22:21:51.1287144Z",
"status": "Creating",
"details": {
"sourceResources": [
{
"resourceType": "Dimension",
"name": "ResourceGroupName",
"values": [
"sampleRG"
]
}
],
"targetResources": [
{
"resourceType": "Dimension",
"policyType": "FixedProportion",
"name": "ResourceGroupName",
"values": [
{
"name": "destinationRG",
"percentage": 50
},
{
"name": "destinationRG2",
"percentage": 50
}
]
}
]
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"parameters": {
"api-version": "2020-03-01-preview",
"billingAccountId": "100",
"ruleName": "testRule",
"costAllocationRule": {
"properties": {
"description": "This is a testRule",
"status": "Active",
"details": {
"sourceResources": [
{
"resourceType": "Tag",
"name": "category",
"values": [
"devops"
]
}
],
"targetResources": [
{
"resourceType": "Dimension",
"policyType": "FixedProportion",
"name": "ResourceGroupName",
"values": [
{
"name": "destinationRG",
"percentage": 33.33
},
{
"name": "destinationRG2",
"percentage": 33.33
},
{
"name": "destinationRG3",
"percentage": 33.34
}
]
}
]
}
}
}
},
"responses": {
"200": {
"body": {
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
"name": "testRule",
"type": "Microsoft.CostManagement/costAllocationRules",
"properties": {
"description": "This is a testRule",
"createdDate": "2020-06-18T22:21:51.1287144Z",
"updatedDate": "2020-06-18T22:21:51.1287144Z",
"status": "Creating",
"details": {
"sourceResources": [
{
"resourceType": "Dimension",
"name": "ResourceGroupName",
"values": [
"sampleRG"
]
}
],
"targetResources": [
{
"resourceType": "Dimension",
"policyType": "FixedProportion",
"name": "ResourceGroupName",
"values": [
{
"name": "destinationRG",
"percentage": 50
},
{
"name": "destinationRG2",
"percentage": 50
}
]
}
]
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"parameters": {
"api-version": "2020-03-01-preview",
"billingAccountId": "100",
"ruleName": "testRule"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"parameters": {
"api-version": "2020-03-01-preview",
"billingAccountId": "100",
"ruleName": "testRule"
},
"responses": {
"200": {
"body": {
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
"name": "testRule",
"type": "Microsoft.CostManagement/costAllocationRules",
"properties": {
"description": "This is a testRule",
"createdDate": "2020-06-18T22:21:51.1287144Z",
"updatedDate": "2020-06-18T22:21:51.1287144Z",
"status": "NotActive",
"details": {
"sourceResources": [
{
"resourceType": "Dimension",
"name": "ResourceGroupName",
"values": [
"sampleRG"
]
}
],
"targetResources": [
{
"resourceType": "Dimension",
"policyType": "FixedProportion",
"name": "ResourceGroupName",
"values": [
{
"name": "destinationRG",
"percentage": 50
},
{
"name": "destinationRG2",
"percentage": 50
}
]
}
]
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"parameters": {
"api-version": "2020-03-01-preview",
"billingAccountId": "100"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
"name": "testRule",
"type": "Microsoft.CostManagement/costAllocationRules",
"properties": {
"description": "This is a testRule",
"createdDate": "2020-06-18T22:21:51.1287144Z",
"updatedDate": "2020-06-18T22:21:51.1287144Z",
"status": "NotActive",
"details": {
"sourceResources": [
{
"resourceType": "Dimension",
"name": "ResourceGroupName",
"values": [
"sampleRG"
]
}
],
"targetResources": [
{
"resourceType": "Dimension",
"policyType": "FixedProportion",
"name": "ResourceGroupName",
"values": [
{
"name": "destinationRG",
"percentage": 50
},
{
"name": "destinationRG2",
"percentage": 50
}
]
}
]
}
}
},
{
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule2",
"name": "testRule2",
"type": "Microsoft.CostManagement/costAllocationRules",
"properties": {
"description": "This is a second test Rule",
"createdDate": "2020-06-18T22:21:51.1287144Z",
"updatedDate": "2020-06-18T22:21:51.1287144Z",
"status": "Active",
"details": {
"sourceResources": [
{
"resourceType": "Dimension",
"name": "SubscriptionId",
"values": [
"2A002F2D-536F-4D7C-90DA-3D0BAE879B0E"
]
}
],
"targetResources": [
{
"resourceType": "Tag",
"policyType": "FixedProportion",
"name": "category",
"values": [
{
"name": "devops",
"percentage": 100
}
]
}
]
}
}
},
{
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule3",
"name": "testRule3",
"type": "Microsoft.CostManagement/costAllocationRules",
"properties": {
"description": "This is a third test Rule",
"createdDate": "2020-06-18T22:21:51.1287144Z",
"updatedDate": "2020-06-18T22:21:51.1287144Z",
"status": "Active",
"details": {
"sourceResources": [
{
"resourceType": "Tag",
"name": "category",
"values": [
"devops"
]
}
],
"targetResources": [
{
"resourceType": "Dimension",
"policyType": "FixedProportion",
"name": "ResourceGroupName",
"values": [
{
"name": "ResourceGroup",
"percentage": 55.55
},
{
"name": "ResourceGroupSecond",
"percentage": 44.45
}
]
}
]
}
}
}
],
"nextLink": null
}
}
}
}
Loading

0 comments on commit 7ac0082

Please sign in to comment.