For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/fr/api/latest/reference-tables/update-reference-table.md. A documentation index is available at /llms.txt.
Language
Datadog site

Mettre à jour une table de référence

PATCHhttps://api.datadoghq.com/api/v2/reference-tables/tables/{id}https://api.us3.datadoghq.com/api/v2/reference-tables/tables/{id}https://api.us5.datadoghq.com/api/v2/reference-tables/tables/{id}https://api.datadoghq.eu/api/v2/reference-tables/tables/{id}https://api.ap1.datadoghq.com/api/v2/reference-tables/tables/{id}https://api.ap2.datadoghq.com/api/v2/reference-tables/tables/{id}https://api.uk1.datadoghq.com/api/v2/reference-tables/tables/{id}https://api.ddog-gov.com/api/v2/reference-tables/tables/{id}https://api.us2.ddog-gov.com/api/v2/reference-tables/tables/{id}

Présentation

Mettre à jour une table de référence par ID. Vous pouvez mettre à jour les données, la description et les tags de la table. Remarque : le type de source ne peut pas être modifié après la création de la table. Pour les mises à jour de données : pour les tables existantes de type source:LOCAL_FILE, appelez d'abord POST api/v2/reference-tables/uploads pour obtenir un ID d'importation, puis envoyez des blocs de données CSV via PUT vers chaque URL fournie, et appelez enfin cet endpoint PATCH avec l'upload_id dans file_metadata. Pour les tables existantes avec des types source: de type S3, GCS ou AZURE, fournissez des access_details mis à jour dans file_metadata pointant vers un fichier CSV dans le même type de stockage cloud.

Arguments

Paramètres du chemin

Name
Type
Description
id [required]
string

Unique identifier of the reference table to update

Requête

Body Data (required)

Champ
Type
Description
data
object

Corps de la requête pour la mise à jour d'une table de référence existante.

Réponse

OK

Exemple de code

Mettre à jour une table de référence
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF
# Path parameters
export 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/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "description": "this is a cloud table generated via a cloud bucket sync",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "test-account-id",
            "aws_bucket_name": "test-bucket",
            "file_path": "test_rt.csv"
          }
        },
        "sync_enabled": true
      },
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "tags": [
        "test_tag"
      ]
    },
    "type": "reference_table"
  }
}
EOF