Skip to main content

datastores

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

Overview

Namedatastores
TypeResource
Iddatadog.actions.datastores

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the datastore.
attributesobjectDetailed information about a datastore.
typestringThe resource type for datastores. (datastores) (default: datastores, example: datastores)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_datastoreselectdatastore_idRetrieves a specific datastore by its ID.
list_datastoresselectLists all datastores for the organization.
create_datastoreinsertCreates a new datastore.
update_datastoreupdatedatastore_idUpdates an existing datastore's attributes.
delete_datastoredeletedatastore_idDeletes a datastore by its unique identifier.

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
datastore_idstringThe unique identifier of the datastore to retrieve.
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.

SELECT examples

Retrieves a specific datastore by its ID.

SELECT
id,
attributes,
type
FROM datadog.actions.datastores
WHERE datastore_id = '{{ datastore_id }}' -- required
;

INSERT examples

Creates a new datastore.

INSERT INTO datadog.actions.datastores (
data
)
SELECT
'{{ data }}'
RETURNING
data
;

UPDATE examples

Updates an existing datastore's attributes.

UPDATE datadog.actions.datastores
SET
data = '{{ data }}'
WHERE
datastore_id = '{{ datastore_id }}' --required
RETURNING
data;

DELETE examples

Deletes a datastore by its unique identifier.

DELETE FROM datadog.actions.datastores
WHERE datastore_id = '{{ datastore_id }}' --required
;