datastore_items
Creates, updates, deletes, gets or lists a datastore_items
resource.
Overview
Name | datastore_items |
Type | Resource |
Id | datadog.actions.datastore_items |
Fields
The following fields are returned by SELECT
queries:
- list_datastore_items
Name | Datatype | Description |
---|---|---|
id | string | The unique identifier of the datastore. |
attributes | object | Metadata and content of a datastore item. |
type | string | The resource type for datastore items. (default: items, example: items) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_datastore_items | select | datastore_id , region | filter , item_key , page[limit] , page[offset] , sort | 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. |
bulk_write_datastore_items | insert | datastore_id , region | Creates or replaces multiple items in a datastore by their keys in a single operation. | |
update_datastore_item | update | datastore_id , region | Partially updates an item in a datastore by its key. | |
delete_datastore_item | delete | datastore_id , region | Deletes 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.
Name | Datatype | Description |
---|---|---|
datastore_id | string | The unique identifier of the datastore to retrieve. |
region | string | (default: datadoghq.com) |
filter | string | Optional query filter to search items using the logs search syntax. |
item_key | string | Optional 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. |
sort | string | Optional field to sort results by. Prefix with '-' for descending order (e.g., '-created_at'). |
SELECT
examples
- list_datastore_items
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
- bulk_write_datastore_items
- Manifest
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
;
# Description fields are for documentation purposes
- name: datastore_items
props:
- name: datastore_id
value: string
description: Required parameter for the datastore_items resource.
- name: region
value: string
description: Required parameter for the datastore_items resource.
- name: data
value: object
description: |
Data wrapper containing the items to insert and their configuration for the bulk insert operation.
UPDATE
examples
- update_datastore_item
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
- delete_datastore_item
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
;