agents
Creates, updates, deletes, gets or lists an agents resource.
Overview
| Name | agents |
| Type | Resource |
| Id | datadog.fleet.agents |
Fields
The following fields are returned by SELECT queries:
- get_fleet_agent_detail_v2
- list_fleet_agents_v2
| Name | Datatype | Description |
|---|---|---|
id | string | The unique agent key identifier. (example: a1b2c3d4e5f67890a1b2c3d4e5f67890) |
attributes | object | Attributes for the v2 agent detail response. |
type | string | The type of the agent resource. (agent) (default: agent, example: agent) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique agent key identifier. (example: my-agent-hostname) |
attributes | object | Attributes of a Datadog Agent in the v2 list response. |
type | string | The type of the agent resource. (agent) (default: agent, example: agent) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_fleet_agent_detail_v2 | select | agent_key | include | Retrieve detailed information about a specific Datadog Agent.<br /><br />By default, only agent_infos is returned. Use the include query parameter to<br />request additional data: integrations and/or configuration_files. |
list_fleet_agents_v2 | select | page_number, page_size, filter, tags, sort_attribute, sort_descending | Retrieve a paginated list of Datadog Agents.<br /><br />Returns agents with support for pagination, sorting, and filtering.<br />Use page_number and page_size to navigate pages, filter to narrow by field values,<br />and tags to filter by agent tags. |
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 |
|---|---|---|
agent_key | string | The unique identifier (Agent key) for the Datadog Agent. Must be a 32-character lowercase hexadecimal string. (example: a1b2c3d4e5f67890a1b2c3d4e5f67890) |
site | string | The 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 | string | Filter string to narrow down agent results. (example: hostname:my-hostname OR env:dev) |
include | string | Comma-separated list of additional fields to include in the response. Valid values are integrations and configuration_files. Omitting this parameter returns only agent_infos. Unrecognized values are silently ignored rather than causing an error. (example: integrations,configuration_files) |
page_number | integer (int64) | Page number for pagination, starting at 0. |
page_size | integer (int64) | Number of agents to return per page. Maximum value is 100. Defaults to 10. |
sort_attribute | string | Agent attribute to sort results by. Must be a supported attribute name; unsupported values return a 400 error. |
sort_descending | boolean | Set to true to sort results in descending order. Defaults to ascending. |
tags | string | Comma-separated list of tag keys to select which tags are included in each agent's tags attribute. Does not filter which agents are returned. |
SELECT examples
- get_fleet_agent_detail_v2
- list_fleet_agents_v2
Retrieve detailed information about a specific Datadog Agent.<br /><br />By default, only agent_infos is returned. Use the include query parameter to<br />request additional data: integrations and/or configuration_files.
SELECT
id,
attributes,
type
FROM datadog.fleet.agents
WHERE agent_key = '{{ agent_key }}' -- required
AND include = '{{ include }}'
;
Retrieve a paginated list of Datadog Agents.<br /><br />Returns agents with support for pagination, sorting, and filtering.<br />Use page_number and page_size to navigate pages, filter to narrow by field values,<br />and tags to filter by agent tags.
SELECT
id,
attributes,
type
FROM datadog.fleet.agents
WHERE page_number = '{{ page_number }}'
AND page_size = '{{ page_size }}'
AND filter = '{{ filter }}'
AND tags = '{{ tags }}'
AND sort_attribute = '{{ sort_attribute }}'
AND sort_descending = '{{ sort_descending }}'
;