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. (default: items, example: items)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_datastore_itemsselectdatastore_id, regionfilter, 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_id, regionCreates or replaces multiple items in a datastore by their keys in a single operation.
update_datastore_itemupdatedatastore_id, regionPartially updates an item in a datastore by its key.
delete_datastore_itemdeletedatastore_id, regionDeletes 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.
regionstring(default: datadoghq.com)
filterstringOptional query filter to search items using the logs 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 region = '{{ region }}' -- 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__data,
datastore_id,
region
)
SELECT
'{{ data }}',
'{{ datastore_id }}',
'{{ region }}'
RETURNING
data
;

UPDATE examples

Partially updates an item in a datastore by its key.

UPDATE datadog.actions.datastore_items
SET
data__data = '{{ data }}'
WHERE
datastore_id = '{{ datastore_id }}' --required
AND region = '{{ region }}' --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
AND region = '{{ region }}' --required
;