For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/experiments/update-exposure-sql-model.md. A documentation index is available at /llms.txt.
Language
Datadog site
PRECAUCIÓNEste producto no es compatible con el sitio Datadog seleccionado. (US1-FED).
PRECAUCIÓNEste producto no es compatible con el sitio Datadog seleccionado. (US2-FED).

Update exposure SQL model

PUThttps://api.datadoghq.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.us3.datadoghq.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.us5.datadoghq.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.datadoghq.eu/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.ap1.datadoghq.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.ap2.datadoghq.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.uk1.datadoghq.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.ddog-gov.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}https://api.us2.ddog-gov.com/api/v2/experiments/exposure-sql-models/{exposure_sql_model_id}

Descripción general

Replace an exposure SQL model. This is a full replacement and is destructive: any subject type or property not present in the body is deleted, and properties are matched on name, column_name and column_type together, so changing one of those replaces the property rather than editing it. Send the complete set you want to keep. Anything removed is listed under meta.removed_subject_type_ids and meta.removed_property_names in the response. The warehouse connection is not settable and is left as stored.

This endpoint requires the product_analytics_warehouse_model_write permission.

OAuth apps require the product_analytics_warehouse_model_write authorization scope to access this endpoint.

Argumentos

Parámetros de ruta

Nombre
Type
Descripción
exposure_sql_model_id [required]
string

The UUID of the exposure SQL model.

Cadenas de consulta

Nombre
Type
Descripción
include
array

Optional fields to include. Repeat this parameter to request several fields. counts adds experiment_count to the updated model.

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
object

Exposure SQL model resource to create.

Respuesta

OK

Updated exposure SQL model and its removed entries.

Campo
Type
Descripción
data [required]
object

Exposure SQL model resource with its identifier and configuration.

meta
object

Removed model entries. Present only when the update removes an entry.

Ejemplo de código

Update exposure SQL model
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF
# Path parameters
export exposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000"

# 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 PUT "https://api.${DD_SITE}/api/v2/experiments/exposure-sql-models/${exposure_sql_model_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "date_partition_column": null,
      "experiment_column": "experiment_id",
      "name": "Exposure events",
      "sql": "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
      "subject_types": [
        {
          "column_name": "user_id",
          "subject_type_id": "550e8400-e29b-41d4-a716-446655440010"
        }
      ],
      "timestamp_column": "exposed_at",
      "variant_column": "variant"
    },
    "type": "exposure-sql-models"
  }
}
EOF