Skip to main content

reference_tables

Creates, updates, deletes, gets or lists a reference_tables resource.

Overview

Namereference_tables
TypeResource
Iddatadog.integrations.reference_tables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier for the reference table.
attributesobjectAttributes that define the reference table's configuration and properties.
typestringReference table resource type. (reference_table) (default: reference_table, example: reference_table)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_tableselectidGet a reference table by ID
list_tablesselectpage[limit], page[offset], sort, filter[status], filter[table_name][exact], filter[table_name][contains]List all reference tables in this organization.
create_reference_tableinsertCreates 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_tableupdateidUpdate 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_tabledeleteidDelete 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.

NameDatatypeDescription
idstringUnique identifier of the reference table to delete
sitestringThe 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]stringFilter by table status. (example: DONE)
filter[table_name][contains]stringFilter by table name containing substring. (example: user)
filter[table_name][exact]stringFilter 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)
sortstringSort field and direction for the list of reference tables. Use field name for ascending, prefix with "-" for descending. (example: -updated_at)

SELECT examples

Get a reference table by ID

SELECT
id,
attributes,
type
FROM datadog.integrations.reference_tables
WHERE id = '{{ id }}' -- required
;

INSERT examples

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
;

UPDATE examples

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 a reference table by ID

DELETE FROM datadog.integrations.reference_tables
WHERE id = '{{ id }}' --required
;