For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/es/api/latest/fleet-automation/list-all-datadog-agents.md. A documentation index is available at /llms.txt.
Language
Datadog site

List all Datadog Agents

GEThttps://api.datadoghq.com/api/v2/fleet/agentshttps://api.us3.datadoghq.com/api/v2/fleet/agentshttps://api.us5.datadoghq.com/api/v2/fleet/agentshttps://api.datadoghq.eu/api/v2/fleet/agentshttps://api.ap1.datadoghq.com/api/v2/fleet/agentshttps://api.ap2.datadoghq.com/api/v2/fleet/agentshttps://api.uk1.datadoghq.com/api/v2/fleet/agentshttps://api.ddog-gov.com/api/v2/fleet/agentshttps://api.us2.ddog-gov.com/api/v2/fleet/agents

Descripción general

Retrieve a paginated list of Datadog Agents.

Returns agents with support for pagination, sorting, and filtering. Use page_number and page_size to navigate pages, filter to narrow by field values, and tags to filter by agent tags.

This endpoint requires the hosts_read permission.

Argumentos

Cadenas de consulta

Nombre
Type
Descripción
page_number
integer

Page number for pagination, starting at 0.

Default: 0
page_size
integer

Number of agents to return per page. Maximum value is 100. Defaults to 10.

Default: 10
filter
string

Filter string to narrow down agent results.

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.

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.

Respuesta

OK

Response containing a paginated list of Datadog Agents.

Campo
Type
Descripción
data [required]
[object]

Array of agents matching the query criteria.

meta
object

Metadata for the v2 list of agents, including pagination information.

Ejemplo de código

List all Datadog Agents
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/fleet/agents" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"