For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ja/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}

概要

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.

引数

パスパラメーター

名前
タイプ
説明
ruleset_id [required]
string

The unique identifier of the ruleset

リクエスト

Body Data (required)

フィールド
タイプ
説明
data
object

The definition of UpdateRulesetRequestData object.

応答

OK

The definition of RulesetResp object.

フィールド
タイプ
説明
data
object

The definition of RulesetRespData object.

コード例

Update tag pipeline ruleset returns "OK" response
# 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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_not_exists": true,
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "type": "update_ruleset"
  }
}
EOF
Update tag pipeline ruleset with if_tag_exists returns "OK" response
# 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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "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": 3611102,
      "rules": [
        {
          "enabled": true,
          "mapping": {
            "destination_key": "team_owner",
            "if_tag_exists": "replace",
            "source_keys": [
              "account_name",
              "account_id"
            ]
          },
          "name": "Account Name Mapping",
          "query": null,
          "reference_table": null
        }
      ]
    },
    "id": "New Ruleset",
    "type": "update_ruleset"
  }
}
EOF