For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ko/api/latest/tag-rules/update-a-tag-rule.md. A documentation index is available at /llms.txt.
Language
Datadog site

태그 규칙 업데이트

경고Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
PATCHhttps://api.datadoghq.com/api/v2/governance/tag_rules/{rule_id}https://api.us3.datadoghq.com/api/v2/governance/tag_rules/{rule_id}https://api.us5.datadoghq.com/api/v2/governance/tag_rules/{rule_id}https://api.datadoghq.eu/api/v2/governance/tag_rules/{rule_id}https://api.ap1.datadoghq.com/api/v2/governance/tag_rules/{rule_id}https://api.ap2.datadoghq.com/api/v2/governance/tag_rules/{rule_id}https://api.uk1.datadoghq.com/api/v2/governance/tag_rules/{rule_id}https://api.ddog-gov.com/api/v2/governance/tag_rules/{rule_id}https://api.us2.ddog-gov.com/api/v2/governance/tag_rules/{rule_id}

개요

기존 태그 규칙의 하나 이상의 속성을 업데이트합니다. 요청 본문에 제공된 필드만 수정되며 생략된 필드는 현재 값을 유지합니다. 규칙의 source는 생성 후 변경할 수 없습니다.

This endpoint requires the telemetry_rules_create permission.

인수

경로 파라미터

이름
유형
설명
rule_id [required]
string

The unique identifier of the tag rule to update.

요청

Body Data (required)

항목
유형
설명
data [required]
object

기존 태그 규칙을 업데이트하기 위한 페이로드입니다. 제공된 필드만 수정됩니다.

응답

OK

A single tag rule.

항목
유형
설명
data [required]
object

A tag rule resource.

included
[object]

Related resources fetched alongside the primary tag rules. Populated when an include query parameter is supplied.

코드 예시

태그 규칙 업데이트
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF
# Path parameters
export rule_id="123"

# 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/governance/tag_rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enabled": true,
      "name": "Service tag must be one of api, web, or worker"
    },
    "id": "123",
    "type": "tag_rule"
  }
}
EOF