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/upsert-rows.md. A documentation index is available at /llms.txt.
Language
Datadog site

Faire un upsert de lignes

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

Présentation

Créer ou mettre à jour des lignes dans une table de référence en fonction de leurs valeurs de clé primaire. Si une ligne avec la clé primaire spécifiée existe, elle est mise à jour ; sinon, une nouvelle ligne est créée.

Arguments

Paramètres du chemin

Name
Type
Description
id [required]
string

Unique identifier of the reference table to upsert rows into

Requête

Body Data (required)

Champ
Type
Description
data [required]
[object]

Corps de la requête pour la création ou la mise à jour de plusieurs lignes dans une table de référence.

Réponse

Rows created or updated successfully

Exemple de code

# 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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
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 POST "https://api.${DD_SITE}/api/v2/reference-tables/tables/${id}/rows" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "values": {
          "age": 25,
          "example_key_value": "primary_key_value",
          "name": "row_name"
        }
      },
      "id": "primary_key_value",
      "type": "row"
    }
  ]
}
EOF