reference_tables
Creates, updates, deletes, gets or lists a reference_tables resource.
Overview
| Name | reference_tables |
| Type | Resource |
| Id | datadog.integrations.reference_tables |
Fields
The following fields are returned by SELECT queries:
- get_table
- list_tables
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the reference table. |
attributes | object | Attributes that define the reference table's configuration and properties. |
type | string | Reference table resource type. (reference_table) (default: reference_table, example: reference_table) |
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the reference table. |
attributes | object | Attributes that define the reference table's configuration and properties. |
type | string | Reference table resource type. (reference_table) (default: reference_table, example: reference_table) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_table | select | id | Get a reference table by ID | |
list_tables | select | page[limit], page[offset], sort, filter[status], filter[table_name][exact], filter[table_name][contains] | List all reference tables in this organization. | |
create_reference_table | insert | Creates a reference table. You can provide data in two ways:<br />1. Call POST /api/v2/reference-tables/upload to get an upload ID. Then, PUT the CSV data<br /> (not the file itself) in chunks to each URL in the request body. Finally, call this<br /> POST endpoint with upload_id in file_metadata.<br />2. Provide access_details in file_metadata pointing to a CSV file in cloud storage. | ||
update_reference_table | update | id | Update a reference table by ID. You can update the table's data, description, and tags. Note: The source type cannot be changed after table creation. For data updates: For existing tables of type source:LOCAL_FILE, call POST api/v2/reference-tables/uploads first to get an upload ID, then PUT chunks of CSV data to each provided URL, and finally call this PATCH endpoint with the upload_id in file_metadata. For existing tables with source: types of S3, GCS, or AZURE, provide updated access_details in file_metadata pointing to a CSV file in the same type of cloud storage. | |
delete_table | delete | id | Delete a reference table by ID |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier of the reference table to delete |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
filter[status] | string | Filter by table status. (example: DONE) |
filter[table_name][contains] | string | Filter by table name containing substring. (example: user) |
filter[table_name][exact] | string | Filter by exact table name match. (example: my_reference_table) |
page[limit] | integer (int64) | Number of tables to return. (example: 15) |
page[offset] | integer (int64) | Number of tables to skip for pagination. (example: 0) |
sort | string | Sort field and direction for the list of reference tables. Use field name for ascending, prefix with "-" for descending. (example: -updated_at) |
SELECT examples
- get_table
- list_tables
Get a reference table by ID
SELECT
id,
attributes,
type
FROM datadog.integrations.reference_tables
WHERE id = '{{ id }}' -- required
;
List all reference tables in this organization.
SELECT
id,
attributes,
type
FROM datadog.integrations.reference_tables
WHERE page[limit] = '{{ page[limit] }}'
AND page[offset] = '{{ page[offset] }}'
AND sort = '{{ sort }}'
AND filter[status] = '{{ filter[status] }}'
AND filter[table_name][exact] = '{{ filter[table_name][exact] }}'
AND filter[table_name][contains] = '{{ filter[table_name][contains] }}'
;
INSERT examples
- create_reference_table
- Manifest
Creates a reference table. You can provide data in two ways:<br />1. Call POST /api/v2/reference-tables/upload to get an upload ID. Then, PUT the CSV data<br /> (not the file itself) in chunks to each URL in the request body. Finally, call this<br /> POST endpoint with upload_id in file_metadata.<br />2. Provide access_details in file_metadata pointing to a CSV file in cloud storage.
INSERT INTO datadog.integrations.reference_tables (
data
)
SELECT
'{{ data }}'
RETURNING
data
;
# Description fields are for documentation purposes
- name: reference_tables
props:
- name: data
description: |
The data object containing the table definition.
value:
attributes:
description: "{{ description }}"
file_metadata:
access_details:
aws_detail:
aws_account_id: "{{ aws_account_id }}"
aws_bucket_name: "{{ aws_bucket_name }}"
file_path: "{{ file_path }}"
azure_detail:
azure_client_id: "{{ azure_client_id }}"
azure_container_name: "{{ azure_container_name }}"
azure_storage_account_name: "{{ azure_storage_account_name }}"
azure_tenant_id: "{{ azure_tenant_id }}"
file_path: "{{ file_path }}"
gcp_detail:
file_path: "{{ file_path }}"
gcp_bucket_name: "{{ gcp_bucket_name }}"
gcp_project_id: "{{ gcp_project_id }}"
gcp_service_account_email: "{{ gcp_service_account_email }}"
sync_enabled: {{ sync_enabled }}
upload_id: "{{ upload_id }}"
schema:
fields:
- name: "{{ name }}"
type: "{{ type }}"
primary_keys:
- "{{ primary_keys }}"
source: "{{ source }}"
table_name: "{{ table_name }}"
tags:
- "{{ tags }}"
type: "{{ type }}"
UPDATE examples
- update_reference_table
Update a reference table by ID. You can update the table's data, description, and tags. Note: The source type cannot be changed after table creation. For data updates: For existing tables of type source:LOCAL_FILE, call POST api/v2/reference-tables/uploads first to get an upload ID, then PUT chunks of CSV data to each provided URL, and finally call this PATCH endpoint with the upload_id in file_metadata. For existing tables with source: types of S3, GCS, or AZURE, provide updated access_details in file_metadata pointing to a CSV file in the same type of cloud storage.
UPDATE datadog.integrations.reference_tables
SET
data = '{{ data }}'
WHERE
id = '{{ id }}' --required;
DELETE examples
- delete_table
Delete a reference table by ID
DELETE FROM datadog.integrations.reference_tables
WHERE id = '{{ id }}' --required
;