devices
Creates, updates, deletes, gets or lists a devices
resource.
Overview
Name | devices |
Type | Resource |
Id | datadog.infrastructure.devices |
Fields
The following fields are returned by SELECT
queries:
- get_device
- list_devices
Name | Datatype | Description |
---|---|---|
id | string | The device ID (example: example:1.2.3.4) |
attributes | object | The device attributes |
type | string | The type of the resource. The value should always be device. |
Name | Datatype | Description |
---|---|---|
id | string | The device ID (example: example:1.2.3.4) |
attributes | object | The device attributes |
type | string | The type of the resource. The value should always be device. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_device | select | device_id , region | Get the device details. | |
list_devices | select | region | page[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.
Name | Datatype | Description |
---|---|---|
device_id | string | The id of the device to fetch. (example: example:1.2.3.4) |
region | string | (default: datadoghq.com) |
filter[tag] | string | Filter devices by tag. (example: status:ok) |
page[number] | integer (int64) | Specific page number to return. |
page[size] | integer (int64) | Size for a given page. The maximum allowed value is 100. |
sort | string | The field to sort the devices by. (example: status) |
SELECT
examples
- get_device
- list_devices
Get the device details.
SELECT
id,
attributes,
type
FROM datadog.infrastructure.devices
WHERE device_id = '{{ device_id }}' -- required
AND region = '{{ region }}' -- required
;
Get the list of devices.
SELECT
id,
attributes,
type
FROM datadog.infrastructure.devices
WHERE region = '{{ region }}' -- required
AND page[size] = '{{ page[size] }}'
AND page[number] = '{{ page[number] }}'
AND sort = '{{ sort }}'
AND filter[tag] = '{{ filter[tag] }}'
;