For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/ja/api/latest/network-device-monitoring/update-the-tags-for-an-interface.md. A documentation index is available at /llms.txt.
Language
Datadog site

インターフェイスのタグの更新

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

概要

指定されたインターフェイスに関連付けられたタグを更新します。

引数

パスパラメーター

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

The ID of the interface for which to update tags.

リクエスト

Body Data (required)

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

インターフェイスタグの一覧表示のための応答。

応答

OK

Response for listing interface tags.

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

Response data for listing interface tags.

コード例

Update the tags for an interface returns "OK" response
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF
# Path parameters
export interface_id="example:1.2.3.4:1"

# 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/ndm/tags/interfaces/${interface_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "tags": [
        "tag:test",
        "tag:testbis"
      ]
    },
    "id": "example:1.2.3.4:1",
    "type": "tags"
  }
}
EOF