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. (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. (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 | Retrieves the dataset associated with the ID. | |
get_all_datasets | select | Get all datasets that have been configured for an organization. | ||
create_dataset | insert | data | Create a dataset with the configurations in the request. | |
update_dataset | replace | dataset_id, data | Edits the dataset associated with the ID. | |
delete_dataset | delete | dataset_id | 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) |
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. |
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
;
Get all datasets that have been configured for an organization.
SELECT
id,
attributes,
type
FROM datadog.metrics.datasets
;
INSERT examples
- create_dataset
- Manifest
Create a dataset with the configurations in the request.
INSERT INTO datadog.metrics.datasets (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: datasets
props:
- name: data
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.
value:
attributes:
name: "{{ name }}"
principals:
- "{{ principals }}"
product_filters:
- filters: "{{ filters }}"
product: "{{ product }}"
type: "{{ type }}"
REPLACE examples
- update_dataset
Edits the dataset associated with the ID.
REPLACE datadog.metrics.datasets
SET
data = '{{ data }}'
WHERE
dataset_id = '{{ dataset_id }}' --required
AND 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
;