List Cloud Cost Management tag keys.
This endpoint requires the cloud_cost_management_read permission.
OAuth apps require the cloud_cost_management_read authorization scope to access this endpoint.
Arguments
Query Strings
Name
Type
Description
filter[metric]
string
The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics.
filter[tags]
array
Filter to return only tag keys that appear with the given key:value tag values. For example, filter[tags]=providername:aws returns tag keys found on the same cost data, such as is_aws_ec2_compute and aws_instance_type.
# List Cloud Cost Management tag keys returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::CloudCostManagementAPI.newpapi_instance.list_cost_tag_keys()
// List Cloud Cost Management tag keys 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.ListCostTagKeys(ctx,*datadogV2.NewListCostTagKeysOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `CloudCostManagementApi.ListCostTagKeys`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `CloudCostManagementApi.ListCostTagKeys`:\n%s\n",responseContent)}
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
/**
* List Cloud Cost Management tag keys returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.CloudCostManagementApi(configuration);apiInstance.listCostTagKeys().then((data: v2.CostTagKeysResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));