datasets
Creates, updates, deletes, gets or lists a datasets
resource.
Overview
Name | datasets |
Type | Resource |
Id | datadog.metrics.datasets |
Fields
The following fields are returned by SELECT
queries:
- get_dataset
- get_all_datasets
Name | Datatype | Description |
---|---|---|
id | string | Unique identifier for the dataset. (example: 123e4567-e89b-12d3-a456-426614174000) |
attributes | object | Dataset metadata and configuration(s). |
type | string | Resource type, always set to dataset . (default: dataset, example: dataset) |
Name | Datatype | Description |
---|---|---|
id | string | Unique identifier for the dataset. (example: 123e4567-e89b-12d3-a456-426614174000) |
attributes | object | Dataset metadata and configuration(s). |
type | string | Resource type, always set to dataset . (default: dataset, example: dataset) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_dataset | select | dataset_id , region | Retrieves the dataset associated with the ID. | |
get_all_datasets | select | region | Get all datasets that have been configured for an organization. | |
create_dataset | insert | region , data__data | Create a dataset with the configurations in the request. | |
update_dataset | replace | dataset_id , region , data__data | Edits the dataset associated with the ID. | |
delete_dataset | delete | dataset_id , region | Deletes 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.
Name | Datatype | Description |
---|---|---|
dataset_id | string | The ID of a defined dataset. (example: 0879ce27-29a1-481f-a12e-bc2a48ec9ae1) |
region | string | (default: datadoghq.com) |
SELECT
examples
- get_dataset
- get_all_datasets
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
;
Get all datasets that have been configured for an organization.
SELECT
id,
attributes,
type
FROM datadog.metrics.datasets
WHERE region = '{{ region }}' -- required
;
INSERT
examples
- create_dataset
- Manifest
Create a dataset with the configurations in the request.
INSERT INTO datadog.metrics.datasets (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data
;
# Description fields are for documentation purposes
- name: datasets
props:
- name: region
value: string
description: Required parameter for the datasets resource.
- name: data
value: object
description: |
**Datasets Object Constraints**
- **Tag limit per dataset**:
- Each restricted dataset supports a maximum of 10 key:value pairs per product.
- **Tag key rules per telemetry type**:
- Only one tag key or attribute may be used to define access within a single telemetry type.
- The same or different tag key may be used across different telemetry types.
- **Tag value uniqueness**:
- Tag values must be unique within a single dataset.
- A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
REPLACE
examples
- update_dataset
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
- delete_dataset
Deletes the dataset associated with the ID.
DELETE FROM datadog.metrics.datasets
WHERE dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
;