Skip to content

Commit 7ac0082

Browse files
authored
[Hub Generated] Review request for Microsoft.CostManagement to add version 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
1 parent d6d4333 commit 7ac0082

File tree

8 files changed

+992
-2
lines changed

8 files changed

+992
-2
lines changed

specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2020-03-01-preview/costallocation.json

Lines changed: 601 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-03-01-preview",
4+
"billingAccountId": "100",
5+
"costAllocationRuleCheckNameAvailabilityRequest": {
6+
"name": "testRule",
7+
"type": "Microsoft.CostManagement/costAllocationRules"
8+
}
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"nameAvailable": false,
14+
"reason": "AlreadyExists",
15+
"message": "A cost allocation rule with name testRule is already present for the billing account 100. Please specify a differnt name."
16+
}
17+
}
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-03-01-preview",
4+
"billingAccountId": "100",
5+
"ruleName": "testRule",
6+
"costAllocationRule": {
7+
"properties": {
8+
"description": "This is a testRule",
9+
"status": "Active",
10+
"details": {
11+
"sourceResources": [
12+
{
13+
"resourceType": "Dimension",
14+
"name": "ResourceGroupName",
15+
"values": [
16+
"sampleRG",
17+
"secondRG"
18+
]
19+
}
20+
],
21+
"targetResources": [
22+
{
23+
"resourceType": "Dimension",
24+
"policyType": "FixedProportion",
25+
"name": "ResourceGroupName",
26+
"values": [
27+
{
28+
"name": "destinationRG",
29+
"percentage": 45
30+
},
31+
{
32+
"name": "destinationRG2",
33+
"percentage": 54
34+
}
35+
]
36+
}
37+
]
38+
}
39+
}
40+
}
41+
},
42+
"responses": {
43+
"200": {
44+
"body": {
45+
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
46+
"name": "testRule",
47+
"type": "Microsoft.CostManagement/costAllocationRules",
48+
"properties": {
49+
"description": "This is a testRule",
50+
"createdDate": "2020-06-18T22:21:51.1287144Z",
51+
"updatedDate": "2020-06-18T22:21:51.1287144Z",
52+
"status": "Creating",
53+
"details": {
54+
"sourceResources": [
55+
{
56+
"resourceType": "Dimension",
57+
"name": "ResourceGroupName",
58+
"values": [
59+
"sampleRG"
60+
]
61+
}
62+
],
63+
"targetResources": [
64+
{
65+
"resourceType": "Dimension",
66+
"policyType": "FixedProportion",
67+
"name": "ResourceGroupName",
68+
"values": [
69+
{
70+
"name": "destinationRG",
71+
"percentage": 50
72+
},
73+
{
74+
"name": "destinationRG2",
75+
"percentage": 50
76+
}
77+
]
78+
}
79+
]
80+
}
81+
}
82+
}
83+
}
84+
}
85+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-03-01-preview",
4+
"billingAccountId": "100",
5+
"ruleName": "testRule",
6+
"costAllocationRule": {
7+
"properties": {
8+
"description": "This is a testRule",
9+
"status": "Active",
10+
"details": {
11+
"sourceResources": [
12+
{
13+
"resourceType": "Tag",
14+
"name": "category",
15+
"values": [
16+
"devops"
17+
]
18+
}
19+
],
20+
"targetResources": [
21+
{
22+
"resourceType": "Dimension",
23+
"policyType": "FixedProportion",
24+
"name": "ResourceGroupName",
25+
"values": [
26+
{
27+
"name": "destinationRG",
28+
"percentage": 33.33
29+
},
30+
{
31+
"name": "destinationRG2",
32+
"percentage": 33.33
33+
},
34+
{
35+
"name": "destinationRG3",
36+
"percentage": 33.34
37+
}
38+
]
39+
}
40+
]
41+
}
42+
}
43+
}
44+
},
45+
"responses": {
46+
"200": {
47+
"body": {
48+
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
49+
"name": "testRule",
50+
"type": "Microsoft.CostManagement/costAllocationRules",
51+
"properties": {
52+
"description": "This is a testRule",
53+
"createdDate": "2020-06-18T22:21:51.1287144Z",
54+
"updatedDate": "2020-06-18T22:21:51.1287144Z",
55+
"status": "Creating",
56+
"details": {
57+
"sourceResources": [
58+
{
59+
"resourceType": "Dimension",
60+
"name": "ResourceGroupName",
61+
"values": [
62+
"sampleRG"
63+
]
64+
}
65+
],
66+
"targetResources": [
67+
{
68+
"resourceType": "Dimension",
69+
"policyType": "FixedProportion",
70+
"name": "ResourceGroupName",
71+
"values": [
72+
{
73+
"name": "destinationRG",
74+
"percentage": 50
75+
},
76+
{
77+
"name": "destinationRG2",
78+
"percentage": 50
79+
}
80+
]
81+
}
82+
]
83+
}
84+
}
85+
}
86+
}
87+
}
88+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-03-01-preview",
4+
"billingAccountId": "100",
5+
"ruleName": "testRule"
6+
},
7+
"responses": {
8+
"200": {},
9+
"204": {}
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-03-01-preview",
4+
"billingAccountId": "100",
5+
"ruleName": "testRule"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
11+
"name": "testRule",
12+
"type": "Microsoft.CostManagement/costAllocationRules",
13+
"properties": {
14+
"description": "This is a testRule",
15+
"createdDate": "2020-06-18T22:21:51.1287144Z",
16+
"updatedDate": "2020-06-18T22:21:51.1287144Z",
17+
"status": "NotActive",
18+
"details": {
19+
"sourceResources": [
20+
{
21+
"resourceType": "Dimension",
22+
"name": "ResourceGroupName",
23+
"values": [
24+
"sampleRG"
25+
]
26+
}
27+
],
28+
"targetResources": [
29+
{
30+
"resourceType": "Dimension",
31+
"policyType": "FixedProportion",
32+
"name": "ResourceGroupName",
33+
"values": [
34+
{
35+
"name": "destinationRG",
36+
"percentage": 50
37+
},
38+
{
39+
"name": "destinationRG2",
40+
"percentage": 50
41+
}
42+
]
43+
}
44+
]
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-03-01-preview",
4+
"billingAccountId": "100"
5+
},
6+
"responses": {
7+
"200": {
8+
"body": {
9+
"value": [
10+
{
11+
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
12+
"name": "testRule",
13+
"type": "Microsoft.CostManagement/costAllocationRules",
14+
"properties": {
15+
"description": "This is a testRule",
16+
"createdDate": "2020-06-18T22:21:51.1287144Z",
17+
"updatedDate": "2020-06-18T22:21:51.1287144Z",
18+
"status": "NotActive",
19+
"details": {
20+
"sourceResources": [
21+
{
22+
"resourceType": "Dimension",
23+
"name": "ResourceGroupName",
24+
"values": [
25+
"sampleRG"
26+
]
27+
}
28+
],
29+
"targetResources": [
30+
{
31+
"resourceType": "Dimension",
32+
"policyType": "FixedProportion",
33+
"name": "ResourceGroupName",
34+
"values": [
35+
{
36+
"name": "destinationRG",
37+
"percentage": 50
38+
},
39+
{
40+
"name": "destinationRG2",
41+
"percentage": 50
42+
}
43+
]
44+
}
45+
]
46+
}
47+
}
48+
},
49+
{
50+
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule2",
51+
"name": "testRule2",
52+
"type": "Microsoft.CostManagement/costAllocationRules",
53+
"properties": {
54+
"description": "This is a second test Rule",
55+
"createdDate": "2020-06-18T22:21:51.1287144Z",
56+
"updatedDate": "2020-06-18T22:21:51.1287144Z",
57+
"status": "Active",
58+
"details": {
59+
"sourceResources": [
60+
{
61+
"resourceType": "Dimension",
62+
"name": "SubscriptionId",
63+
"values": [
64+
"2A002F2D-536F-4D7C-90DA-3D0BAE879B0E"
65+
]
66+
}
67+
],
68+
"targetResources": [
69+
{
70+
"resourceType": "Tag",
71+
"policyType": "FixedProportion",
72+
"name": "category",
73+
"values": [
74+
{
75+
"name": "devops",
76+
"percentage": 100
77+
}
78+
]
79+
}
80+
]
81+
}
82+
}
83+
},
84+
{
85+
"id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule3",
86+
"name": "testRule3",
87+
"type": "Microsoft.CostManagement/costAllocationRules",
88+
"properties": {
89+
"description": "This is a third test Rule",
90+
"createdDate": "2020-06-18T22:21:51.1287144Z",
91+
"updatedDate": "2020-06-18T22:21:51.1287144Z",
92+
"status": "Active",
93+
"details": {
94+
"sourceResources": [
95+
{
96+
"resourceType": "Tag",
97+
"name": "category",
98+
"values": [
99+
"devops"
100+
]
101+
}
102+
],
103+
"targetResources": [
104+
{
105+
"resourceType": "Dimension",
106+
"policyType": "FixedProportion",
107+
"name": "ResourceGroupName",
108+
"values": [
109+
{
110+
"name": "ResourceGroup",
111+
"percentage": 55.55
112+
},
113+
{
114+
"name": "ResourceGroupSecond",
115+
"percentage": 44.45
116+
}
117+
]
118+
}
119+
]
120+
}
121+
}
122+
}
123+
],
124+
"nextLink": null
125+
}
126+
}
127+
}
128+
}

0 commit comments

Comments
 (0)