Get details for a specific Cloud Cost Management tag key, including example tag values and description.
This endpoint requires the cloud_cost_management_read permission.
OAuth apps require the cloud_cost_management_read authorization scope to access this endpoint.
Arguments
Path Parameters
Name
Type
Description
tag_key [required]
string
The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, kubernetes/instance).
Query Strings
Name
Type
Description
filter[metric]
string
The Cloud Cost Management metric to scope the tag key details to. When omitted, returns details across all metrics.
page[size]
integer
Controls the size of the internal tag value search scope. This does not restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000.
Additional details for a Cloud Cost Management tag key, including its description and example tag values.
description [required]
string
Description of the tag key.
tag_values [required]
[string]
Example tag values observed for this tag key.
sources [required]
[string]
List of sources that define this tag key.
value [required]
string
The tag key name.
id [required]
string
The tag key identifier.
type [required]
enum
Type of the Cloud Cost Management tag key resource.
Allowed enum values: cost_tag_key
default: cost_tag_key
{"data":{"attributes":{"details":{"description":"The cloud provider name reported for the cost line item.","tag_values":["aws","gcp","azure"]},"sources":["focus"],"value":"providername"},"id":"providername","type":"cost_tag_key"}}
"""
Get a Cloud Cost Management tag key returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.cloud_cost_management_apiimportCloudCostManagementApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=CloudCostManagementApi(api_client)response=api_instance.get_cost_tag_key(tag_key="tag_key",)print(response)
# Get a Cloud Cost Management tag key returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CloudCostManagementAPI.newpapi_instance.get_cost_tag_key("tag_key")
// Get a Cloud Cost Management tag key returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewCloudCostManagementApi(apiClient)resp,r,err:=api.GetCostTagKey(ctx,"tag_key",*datadogV2.NewGetCostTagKeyOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CloudCostManagementApi.GetCostTagKey`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CloudCostManagementApi.GetCostTagKey`:\n%s\n",responseContent)}
// Get a Cloud Cost Management tag key returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.CloudCostManagementApi;importcom.datadog.api.client.v2.model.CostTagKeyResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();CloudCostManagementApiapiInstance=newCloudCostManagementApi(defaultClient);try{CostTagKeyResponseresult=apiInstance.getCostTagKey("tag_key");System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling CloudCostManagementApi#getCostTagKey");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a Cloud Cost Management tag key returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;usedatadog_api_client::datadogV2::api_cloud_cost_management::GetCostTagKeyOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=CloudCostManagementAPI::with_config(configuration);letresp=api.get_cost_tag_key("tag_key".to_string(),GetCostTagKeyOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a Cloud Cost Management tag key returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CloudCostManagementApi(configuration);constparams: v2.CloudCostManagementApiGetCostTagKeyRequest={tagKey:"tag_key",};apiInstance.getCostTagKey(params).then((data: v2.CostTagKeyResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));