-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renamed cost allocation tags to cost tags and added schema for get list of all available tag keys #2862
Renamed cost allocation tags to cost tags and added schema for get list of all available tag keys #2862
Changes from 25 commits
7b927cf
c641158
0e276b2
7be4364
bff7aa7
011c9f0
002a6db
020911c
502d70e
b41bd12
7956270
346ce83
a0072f9
ee9bfc3
6df7a9e
7a5eab1
623ff00
6388784
a8d47d1
3ccf1b4
884aabe
3d1c7c1
def6325
ef019c5
1f2de0f
5699a84
3bd6450
7f53393
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1143,19 +1143,19 @@ | |
} | ||
} | ||
}, | ||
"/providers/Microsoft.CostManagement/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/costAllocationTags": { | ||
"/providers/Microsoft.CostManagement/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/costTags": { | ||
"get": { | ||
"tags": [ | ||
"CostAllocationTags" | ||
"CostTags" | ||
], | ||
"operationId": "CostAllocationTags_Get", | ||
"description": "Get cost allocation tags for a billing account.", | ||
"operationId": "CostTags_Get", | ||
"description": "Get cost tags for a billing account.", | ||
"externalDocs": { | ||
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/" | ||
}, | ||
"x-ms-examples": { | ||
"CostAllocationTags_Get": { | ||
"$ref": "./examples/CostAllocationTags.json" | ||
"CostTags_Get": { | ||
"$ref": "./examples/CostTags.json" | ||
} | ||
}, | ||
"parameters": [ | ||
|
@@ -1170,7 +1170,7 @@ | |
"200": { | ||
"description": "OK. The request has succeeded.", | ||
"schema": { | ||
"$ref": "#/definitions/CostAllocationTags" | ||
"$ref": "#/definitions/CostTags" | ||
} | ||
}, | ||
"default": { | ||
|
@@ -1183,16 +1183,16 @@ | |
}, | ||
"put": { | ||
"tags": [ | ||
"CostAllocationTags" | ||
"CostTags" | ||
], | ||
"operationId": "CostAllocationTags_CreateOrUpdate", | ||
"description": "The operation to create or update cost allocation tags assiciated with a billing account. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", | ||
"operationId": "CostTags_CreateOrUpdate", | ||
"description": "The operation to create or update cost tags assiciated with a billing account. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", | ||
"externalDocs": { | ||
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/" | ||
}, | ||
"x-ms-examples": { | ||
"CreateOrUpdateCostAllocationTags": { | ||
"$ref": "./examples/CreateOrUpdateCostAllocationTags.json" | ||
"CreateOrUpdateCostTags": { | ||
"$ref": "./examples/CreateOrUpdateCostTags.json" | ||
} | ||
}, | ||
"parameters": [ | ||
|
@@ -1207,22 +1207,61 @@ | |
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/CostAllocationTags" | ||
"$ref": "#/definitions/CostTags" | ||
}, | ||
"description": "Parameters supplied to the Create cost allocation tags operation." | ||
"description": "Parameters supplied to the Create cost tags operation." | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK. The request has succeeded.", | ||
"schema": { | ||
"$ref": "#/definitions/CostAllocationTags" | ||
"$ref": "#/definitions/CostTags" | ||
} | ||
}, | ||
"201": { | ||
"description": "Created.", | ||
"schema": { | ||
"$ref": "#/definitions/CostAllocationTags" | ||
"$ref": "#/definitions/CostTags" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.CostManagement/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/tags": { | ||
"get": { | ||
"tags": [ | ||
"Tags" | ||
], | ||
"operationId": "Tags_Get", | ||
"description": "Get all available tag keys for a billing account.", | ||
"externalDocs": { | ||
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/" | ||
}, | ||
"x-ms-examples": { | ||
"CostTags_Get": { | ||
"$ref": "./examples/Tags.json" | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/apiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/billingAccountIdParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK. The request has succeeded.", | ||
"schema": { | ||
"$ref": "#/definitions/Tags" | ||
} | ||
}, | ||
"default": { | ||
|
@@ -1868,6 +1907,43 @@ | |
} | ||
} | ||
}, | ||
"Tags": { | ||
"description": "A tag resource.", | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/ProxyResource" | ||
} | ||
], | ||
"properties": { | ||
"properties": { | ||
"x-ms-client-flatten": true, | ||
"$ref": "#/definitions/TagProperties", | ||
"title": "Tag properties" | ||
} | ||
} | ||
}, | ||
"TagProperties": { | ||
"description": "The properties of the tag.", | ||
"properties": { | ||
"costTags": { | ||
"description": "Tags.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more thing : Please avoid using property name as the description. Try to add a little more info :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! I have made the changes. Will keep this in mind for future as well. |
||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Tag" | ||
} | ||
} | ||
} | ||
}, | ||
"Tag": { | ||
"description": "The tag.", | ||
"properties": { | ||
"key": { | ||
"description": "Tag key.", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"BudgetsListResult": { | ||
"description": "Result of listing budgets. It contains a list of available budgets in the scope provided.", | ||
"properties": { | ||
|
@@ -2103,8 +2179,8 @@ | |
"contactEmails" | ||
] | ||
}, | ||
"CostAllocationTags": { | ||
"description": "A cost allocation tag resource.", | ||
"CostTags": { | ||
"description": "A cost tag resource.", | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
|
@@ -2114,28 +2190,28 @@ | |
"properties": { | ||
"properties": { | ||
"x-ms-client-flatten": true, | ||
"$ref": "#/definitions/CostAllocationTagProperties", | ||
"title": "Cost allocation tag properties" | ||
"$ref": "#/definitions/CostTagProperties", | ||
"title": "Cost tag properties" | ||
} | ||
} | ||
}, | ||
"CostAllocationTagProperties": { | ||
"description": "The properties of the cost allocation tag.", | ||
"CostTagProperties": { | ||
"description": "The properties of the cost tag.", | ||
"properties": { | ||
"costAllocationTags": { | ||
"description": "Cost allocation tags.", | ||
"costTags": { | ||
"description": "Cost tags.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/CostAllocationTag" | ||
"$ref": "#/definitions/CostTag" | ||
} | ||
} | ||
} | ||
}, | ||
"CostAllocationTag": { | ||
"description": "The cost allocation tag.", | ||
"CostTag": { | ||
"description": "The cost tag.", | ||
"properties": { | ||
"key": { | ||
"description": "Cost allocation tag key.", | ||
"description": "Cost tag key.", | ||
"type": "string" | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2018-03-31", | ||
"billingAccountId": "12345" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "providers/Microsoft.CostManagement/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/tags/tags1", | ||
"name": "tags1", | ||
"type": "Microsoft.Consumption/tags", | ||
"eTag": "\"1d34d012214157f\"", | ||
"properties": { | ||
"tags": [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The property name here should be "costTags", as defined in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! for mentioning this. Actually it was wrong at the other place. I am corrected it there. |
||
{ | ||
"key": "Department" | ||
}, | ||
{ | ||
"key": "CostCenter" | ||
}, | ||
{ | ||
"key": "Portal" | ||
}, | ||
{ | ||
"key": "OrgName" | ||
}, | ||
{ | ||
"key": "Namespace" | ||
}, | ||
{ | ||
"key": "resourceType" | ||
}, | ||
{ | ||
"key": "Subsystem" | ||
}, | ||
{ | ||
"key": "Environment" | ||
}, | ||
{ | ||
"key": "clusterName" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put in more detailed descriptions. This is easily confused with "Tag".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might even consider renaming this to "TagResource".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the description. Please take a look if the changes are fine.