Skip to content

Commit

Permalink
Added schema spec for cost allocation tags (#2742)
Browse files Browse the repository at this point in the history
* Added Tags filter for budgets and updated the api version

Added Tags filter for budgets and updated the api version

* Updated comments

Updated comments

* Incorporated review comments

Incorporated review comments

* Incorporated review comments

Incorporated review comments

* Incorporated review comment

Incorporated review comment

* Added Tags filter and grouping for UsageDetails

Added Tags filter and grouping for UsageDetails

* Added reservation recommendations and tags

Added reservation recommendations and tags

* Incorporated review comments

Incorporated review comments

* Incorporated review comments

Incorporated review comments

* Removed unwanted space

Removed unwanted space

* Removed extra whitespace

Removed extra whitespace

* add swagger->sdk config for go

* fix broken tags for go

* Added schema spec for cost allocation tags

Added schema spec for cost allocation tags

* Updated Get Operation

Updated Get Operation

* Incorporated review comments

Incorporated review comments

* Review comments incorporated

Review comments incorporated

* Updated path

Updated path
  • Loading branch information
asarkar84 authored and sergey-shandar committed Apr 6, 2018
1 parent 20c1a0e commit 895ab21
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,97 @@
}
}
}
},
"/providers/Microsoft.CostManagement/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/costAllocationTags": {
"get": {
"tags": [
"CostAllocationTags"
],
"operationId": "CostAllocationTags_Get",
"description": "Get cost allocation 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"
}
},
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"$ref": "#/parameters/billingAccountIdParameter"
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/CostAllocationTags"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
},
"put": {
"tags": [
"CostAllocationTags"
],
"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.",
"externalDocs": {
"url": "https://docs.microsoft.com/en-us/rest/api/consumption/"
},
"x-ms-examples": {
"CreateOrUpdateCostAllocationTags": {
"$ref": "./examples/CreateOrUpdateCostAllocationTags.json"
}
},
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"$ref": "#/parameters/billingAccountIdParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CostAllocationTags"
},
"description": "Parameters supplied to the Create cost allocation tags operation."
}
],
"responses": {
"200": {
"description": "OK. The request has succeeded.",
"schema": {
"$ref": "#/definitions/CostAllocationTags"
}
},
"201": {
"description": "Created.",
"schema": {
"$ref": "#/definitions/CostAllocationTags"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -2012,6 +2103,43 @@
"contactEmails"
]
},
"CostAllocationTags": {
"description": "A cost allocation tag resource.",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/CostAllocationTagProperties",
"title": "Cost allocation tag properties"
}
}
},
"CostAllocationTagProperties": {
"description": "The properties of the cost allocation tag.",
"properties": {
"costAllocationTags": {
"description": "Cost allocation tags.",
"type": "array",
"items": {
"$ref": "#/definitions/CostAllocationTag"
}
}
}
},
"CostAllocationTag": {
"description": "The cost allocation tag.",
"properties": {
"key": {
"description": "Cost allocation tag key.",
"type": "string"
}
}
},
"ErrorDetails": {
"description": "The details of the error.",
"properties": {
Expand Down Expand Up @@ -2253,6 +2381,14 @@
"required": true,
"type": "string"
},
"billingAccountIdParameter": {
"name": "billingAccountId",
"in": "path",
"description": "Azure Billing Account ID.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"resourceGroupNameParameter": {
"name": "resourceGroupName",
"in": "path",
Expand Down Expand Up @@ -2296,6 +2432,7 @@
"grainParameter": {
"name": "grain",
"description": "Can be daily or monthly",
"x-ms-parameter-location": "method",
"in": "query",
"required": true,
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parameters": {
"api-version": "2018-03-31",
"billingAccountId": "12345"
},
"responses": {
"200": {
"body": {
"id": "providers/Microsoft.CostManagement/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/costAllocationTags/costAllocationTags1",
"name": "costAllocationTags1",
"type": "Microsoft.Consumption/costAllocationTags",
"eTag": "\"1d34d012214157f\"",
"properties": {
"costAllocationTags": [
{
"key": "Department"
},
{
"key": "CostCenter"
},
{
"key": "Portal"
},
{
"key": "OrgName"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"parameters": {
"api-version": "2018-03-31",
"billingAccountId": "12345",
"parameters": {
"costAllocationTags": [
{
"key": "Department"
},
{
"key": "CostCenter"
},
{
"key": "Portal"
},
{
"key": "OrgName"
}
]
}
},
"responses": {
"201": {
"body": {
"id": "providers/Microsoft.CostManagement/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/costAllocationTags/costAllocationTags1",
"name": "costAllocationTags1",
"type": "Microsoft.Consumption/costAllocationTags",
"eTag": "\"1d34d012214157f\"",
"properties": {
"costAllocationTags": [
{
"key": "Department"
},
{
"key": "CostCenter"
},
{
"key": "Portal"
},
{
"key": "OrgName"
}
]
}
}
},
"200": {
"body": {
"id": "providers/Microsoft.CostManagement/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/costAllocationTags/costAllocationTags1",
"name": "costAllocationTags1",
"type": "Microsoft.Consumption/costAllocationTags",
"eTag": "\"1d34d012214157f\"",
"properties": {
"costAllocationTags": [
{
"key": "Department"
},
{
"key": "CostCenter"
},
{
"key": "Portal"
},
{
"key": "OrgName"
}
]
}
}
}
}
}

0 comments on commit 895ab21

Please sign in to comment.