List tag pipeline rulesets

GET https://api.ap1.datadoghq.com/api/v2/tags/enrichmenthttps://api.ap2.datadoghq.com/api/v2/tags/enrichmenthttps://api.datadoghq.eu/api/v2/tags/enrichmenthttps://api.ddog-gov.com/api/v2/tags/enrichmenthttps://api.us2.ddog-gov.com/api/v2/tags/enrichmenthttps://api.datadoghq.com/api/v2/tags/enrichmenthttps://api.us3.datadoghq.com/api/v2/tags/enrichmenthttps://api.us5.datadoghq.com/api/v2/tags/enrichment

Overview

List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization

OAuth apps require the cloud_cost_management_read authorization scope to access this endpoint.

Response

OK

The definition of RulesetRespArray object.

Expand All

Field

Type

Description

data [required]

[object]

The RulesetRespArray data.

attributes

object

The definition of RulesetRespDataAttributes object.

created [required]

object

The definition of RulesetRespDataAttributesCreated object.

nanos

int32

The created nanos.

seconds

int64

The created seconds.

enabled [required]

boolean

The attributes enabled.

last_modified_user_uuid [required]

string

The attributes last_modified_user_uuid.

modified [required]

object

The definition of RulesetRespDataAttributesModified object.

nanos

int32

The modified nanos.

seconds

int64

The modified seconds.

name [required]

string

The attributes name.

position [required]

int32

The attributes position.

processing_status

string

The attributes processing_status.

rules [required]

[object]

The attributes rules.

enabled [required]

boolean

The items enabled.

mapping

object

The definition of DataAttributesRulesItemsMapping object.

destination_key [required]

string

The mapping destination_key.

if_not_exists

boolean

DEPRECATED: Deprecated. Use if_tag_exists instead. The mapping if_not_exists.

if_tag_exists

enum

The behavior when the tag already exists. Allowed enum values: append,do_not_apply,replace

source_keys [required]

[string]

The mapping source_keys.

metadata

object

The items metadata.

<any-key>

string

name [required]

string

The items name.

query

object

The definition of RulesetRespDataAttributesRulesItemsQuery object.

addition [required]

object

The definition of RulesetRespDataAttributesRulesItemsQueryAddition object.

key [required]

string

The addition key.

value [required]

string

The addition value.

case_insensitivity

boolean

The query case_insensitivity.

if_not_exists

boolean

DEPRECATED: Deprecated. Use if_tag_exists instead. The query if_not_exists.

if_tag_exists

enum

The behavior when the tag already exists. Allowed enum values: append,do_not_apply,replace

query [required]

string

The query query.

reference_table

object

The definition of RulesetRespDataAttributesRulesItemsReferenceTable object.

case_insensitivity

boolean

The reference_table case_insensitivity.

field_pairs [required]

[object]

The reference_table field_pairs.

input_column [required]

string

The items input_column.

output_key [required]

string

The items output_key.

if_not_exists

boolean

DEPRECATED: Deprecated. Use if_tag_exists instead. The reference_table if_not_exists.

if_tag_exists

enum

The behavior when the tag already exists. Allowed enum values: append,do_not_apply,replace

source_keys [required]

[string]

The reference_table source_keys.

table_name [required]

string

The reference_table table_name.

version [required]

int64

The attributes version.

id

string

The RulesetRespData id.

type [required]

enum

Ruleset resource type. Allowed enum values: ruleset

default: ruleset

{
  "data": [
    {
      "attributes": {
        "created": null,
        "enabled": true,
        "last_modified_user_uuid": "",
        "modified": null,
        "name": "Production Cost Allocation Rules",
        "position": 0,
        "rules": [
          {
            "enabled": true,
            "mapping": null,
            "metadata": null,
            "name": "AWS Production Account Tagging",
            "query": {
              "addition": {
                "key": "environment",
                "value": "production"
              },
              "case_insensitivity": false,
              "if_tag_exists": "do_not_apply",
              "query": "billingcurrency:\"USD\" AND account_name:\"prod-account\""
            },
            "reference_table": null
          },
          {
            "enabled": true,
            "mapping": {
              "destination_key": "team_owner",
              "if_tag_exists": "do_not_apply",
              "source_keys": [
                "account_name",
                "service"
              ]
            },
            "metadata": null,
            "name": "Team Mapping Rule",
            "query": null,
            "reference_table": null
          },
          {
            "enabled": true,
            "mapping": null,
            "metadata": null,
            "name": "New table rule with new UI",
            "query": null,
            "reference_table": {
              "case_insensitivity": true,
              "field_pairs": [
                {
                  "input_column": "status_type",
                  "output_key": "status"
                },
                {
                  "input_column": "status_description",
                  "output_key": "dess"
                }
              ],
              "if_tag_exists": "append",
              "source_keys": [
                "http_status",
                "status_description"
              ],
              "table_name": "http_status_codes"
            }
          }
        ],
        "version": 2
      },
      "id": "55ef2385-9ae1-4410-90c4-5ac1b60fec10",
      "type": "ruleset"
    },
    {
      "attributes": {
        "created": null,
        "enabled": true,
        "last_modified_user_uuid": "",
        "modified": null,
        "name": "Development Environment Rules",
        "position": 0,
        "rules": [
          {
            "enabled": true,
            "mapping": null,
            "metadata": null,
            "name": "Dev Account Cost Center",
            "query": {
              "addition": {
                "key": "cost_center",
                "value": "engineering"
              },
              "case_insensitivity": true,
              "if_tag_exists": "do_not_apply",
              "query": "account_name:\"dev-*\""
            },
            "reference_table": null
          }
        ],
        "version": 1
      },
      "id": "a7b8c9d0-1234-5678-9abc-def012345678",
      "type": "ruleset"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/tags/enrichment" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
List tag pipeline rulesets returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = CloudCostManagementApi(api_client)
    response = api_instance.list_tag_pipelines_rulesets()

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py and run following commands:

    
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>" python3 "example.py"
# List tag pipeline rulesets returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
p api_instance.list_tag_pipelines_rulesets()

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
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>" rb "example.rb"
// List tag pipeline rulesets returns "OK" response

package main

import (
	"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"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewCloudCostManagementApi(apiClient)
	resp, r, err := api.ListTagPipelinesRulesets(ctx)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CloudCostManagementApi.ListTagPipelinesRulesets`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `CloudCostManagementApi.ListTagPipelinesRulesets`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
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>" go run "main.go"
// List tag pipeline rulesets returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.CloudCostManagementApi;
import com.datadog.api.client.v2.model.RulesetRespArray;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient);

    try {
      RulesetRespArray result = apiInstance.listTagPipelinesRulesets();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CloudCostManagementApi#listTagPipelinesRulesets");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java and run following commands:

    
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>" java "Example.java"
// List tag pipeline rulesets returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CloudCostManagementAPI::with_config(configuration);
    let resp = api.list_tag_pipelines_rulesets().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
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 tag pipeline rulesets returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.CloudCostManagementApi(configuration);

apiInstance
  .listTagPipelinesRulesets()
  .then((data: v2.RulesetRespArray) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts and run following commands:

    
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>" tsc "example.ts"