Skip to main content

devices

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

Overview

Namedevices
TypeResource
Iddatadog.infrastructure.devices

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe device ID (example: example:1.2.3.4)
attributesobjectThe device attributes
typestringThe type of the resource. The value should always be device.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_deviceselectdevice_idGet the device details.
list_devicesselectpage[size], page[number], sort, filter[tag]Get the list of devices.

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
device_idstringThe id of the device to fetch. (example: example:1.2.3.4)
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.
filter[tag]stringFilter devices by tag. (example: status:ok)
page[number]integer (int64)Specific page number to return. Defaults to 0.
page[size]integer (int64)Size for a given page. The maximum allowed value is 500. Defaults to 50.
sortstringThe field to sort the devices by. Defaults to name. (example: status)

SELECT examples

Get the device details.

SELECT
id,
attributes,
type
FROM datadog.infrastructure.devices
WHERE device_id = '{{ device_id }}' -- required
;