Bulk restart agents Experimental; added in 9.6.0

POST /api/fleet/agents/bulk_restart

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/agents/bulk_restart

Refer to Spaces for more information.

Restart multiple Elastic Agents. Agents that are enrolled in a hosted policy or are on a version earlier than 9.6.0 are excluded from the action and receive individual error results.

[Required authorization] Route required privileges: fleet-agents-all.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • agents array[string] | string Required
    Any of:

    Not more than 10000 elements. Maximum length of each is 512.

    Maximum length is 1000000.

  • batchSize number

    Minimum value is 1.

  • includeInactive boolean

    Default value is false.

Responses

  • 200 application/json

    OK: A successful request.

    Any of:
  • 400 application/json

    A bad request.

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
POST /api/fleet/agents/bulk_restart
curl \
 --request POST 'https://localhost:5601/api/fleet/agents/bulk_restart' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{
  "agents": [
    "agent-1",
    "agent-2"
  ],
  "batchSize": 100,
  "includeInactive": false
}'
Request example
{
  "agents": [
    "agent-1",
    "agent-2"
  ],
  "batchSize": 100,
  "includeInactive": false
}
Response examples (200)
{
  "actionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Response examples (400)
{
  "message": "Bad Request"
}