Skip to main content

datasets

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

Overview

Namedatasets
TypeResource
Iddatadog.metrics.datasets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier for the dataset. (example: 123e4567-e89b-12d3-a456-426614174000)
attributesobjectDataset metadata and configuration(s).
typestringResource type, always set to dataset. (default: dataset, example: dataset)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_datasetselectdataset_id, regionRetrieves the dataset associated with the ID.
get_all_datasetsselectregionGet all datasets that have been configured for an organization.
create_datasetinsertregion, data__dataCreate a dataset with the configurations in the request.
update_datasetreplacedataset_id, region, data__dataEdits the dataset associated with the ID.
delete_datasetdeletedataset_id, regionDeletes the dataset associated with the 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
dataset_idstringThe ID of a defined dataset. (example: 0879ce27-29a1-481f-a12e-bc2a48ec9ae1)
regionstring(default: datadoghq.com)

SELECT examples

Retrieves the dataset associated with the ID.

SELECT
id,
attributes,
type
FROM datadog.metrics.datasets
WHERE dataset_id = '{{ dataset_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Create a dataset with the configurations in the request.

INSERT INTO datadog.metrics.datasets (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data
;

REPLACE examples

Edits the dataset associated with the ID.

REPLACE datadog.metrics.datasets
SET
data__data = '{{ data }}'
WHERE
dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Deletes the dataset associated with the ID.

DELETE FROM datadog.metrics.datasets
WHERE dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
;