For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/api/latest/cloud-cost-management/update-tag-pipeline-ruleset.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update tag pipeline ruleset

PATCHhttps://api.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us3.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.us5.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.datadoghq.eu/api/v2/tags/enrichment/{ruleset_id}https://api.ap1.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.ap2.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.uk1.datadoghq.com/api/v2/tags/enrichment/{ruleset_id}https://api.ddog-gov.com/api/v2/tags/enrichment/{ruleset_id}https://api.us2.ddog-gov.com/api/v2/tags/enrichment/{ruleset_id}

Overview

Update a tag pipeline ruleset - Update an existing tag pipeline ruleset with new rules and configuration

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

Arguments

Path Parameters

Name
Type
Description
ruleset_id [required]
string

The unique identifier of the ruleset

Request

Body Data (required)

Field
Type
Description
data
object

The definition of UpdateRulesetRequestData object.

Response

OK

The definition of RulesetResp object.

Field
Type
Description
data
object

The definition of RulesetRespData object.

Code Example

# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF
# Path parameters
export ruleset_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/tags/enrichment/${ruleset_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "last_version": 1,
      "name": "Updated Ruleset",
      "rules": [
        {
          "enabled": true,
          "name": "Add Cost Center Tag",
          "query": {
            "addition": {
              "key": "cost_center",
              "value": "engineering"
            },
            "case_insensitivity": false,
            "if_tag_exists": "do_not_apply",
            "query": "account_id:\"123456789\" AND service:\"web-api\""
          }
        },
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "do_not_apply",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null
        },
        {
          "enabled": true,
          "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"
          }
        }
      ]
    },
    "type": "update_ruleset"
  }
}
EOF