Skip to main content

datastore_items

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

Overview

Namedatastore_items
TypeResource
Iddatadog.actions.datastore_items

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier of the datastore.
attributesobjectMetadata and content of a datastore item.
typestringThe resource type for datastore items. (items) (default: items, example: items)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_datastore_itemsselectdatastore_idfilter, item_key, page[limit], page[offset], sortLists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets.
bulk_write_datastore_itemsinsertdatastore_idCreates or replaces multiple items in a datastore by their keys in a single operation.
update_datastore_itemupdatedatastore_idPartially updates an item in a datastore by its key.
delete_datastore_itemdeletedatastore_idDeletes an item from a datastore by its key.

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.
filterstringOptional query filter to search items using the [logs search syntax](https:​//docs.datadoghq.com/logs/explorer/search_syntax/).
item_keystringOptional primary key value to retrieve a specific item. Cannot be used together with the filter parameter.
page[limit]integer (int64)Optional field to limit the number of items to return per page for pagination. Up to 100 items can be returned per page.
page[offset]integer (int64)Optional field to offset the number of items to skip from the beginning of the result set for pagination.
sortstringOptional field to sort results by. Prefix with '-' for descending order (e.g., '-created_at').

SELECT examples

Lists items from a datastore. You can filter the results by specifying either an item key or a filter query parameter, but not both at the same time. Supports server-side pagination for large datasets.

SELECT
id,
attributes,
type
FROM datadog.actions.datastore_items
WHERE datastore_id = '{{ datastore_id }}' -- required
AND filter = '{{ filter }}'
AND item_key = '{{ item_key }}'
AND page[limit] = '{{ page[limit] }}'
AND page[offset] = '{{ page[offset] }}'
AND sort = '{{ sort }}'
;

INSERT examples

Creates or replaces multiple items in a datastore by their keys in a single operation.

INSERT INTO datadog.actions.datastore_items (
data,
datastore_id
)
SELECT
'{{ data }}',
'{{ datastore_id }}'
RETURNING
data
;

UPDATE examples

Partially updates an item in a datastore by its key.

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

DELETE examples

Deletes an item from a datastore by its key.

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