POST /api/fleet/agents/bulk_migrate

Spaces method and path for this operation:

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

Refer to Spaces for more information.

Bulk migrate agents to another cluster.

[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.

  • batchSize number
  • enrollment_token string Required
  • settings object

    Additional properties are NOT allowed.

    Hide settings attributes Show settings attributes object
    • ca_sha256 string
    • certificate_authorities string
    • elastic_agent_cert string
    • elastic_agent_cert_key string
    • elastic_agent_cert_key_passphrase string
    • headers object
      Hide headers attribute Show headers attribute object
      • * string Additional properties
    • insecure boolean
    • proxy_disabled boolean
    • proxy_headers object
      Hide proxy_headers attribute Show proxy_headers attribute object
      • * string Additional properties
    • proxy_url string
    • staging string
    • tags array[string]

      Not more than 10 elements.

  • uri string(uri) Required

Responses

  • 200 application/json

    Successful response

    Hide response attribute Show response attribute object
    • actionId string Required
  • 400 application/json

    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_migrate
curl \
 --request POST 'https://<KIBANA_URL>/api/fleet/agents/bulk_migrate' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{"agents":["agent-id-1","agent-id-2"],"enrollment_token":"enrollment-token-value","settings":{"retry_max":5},"uri":"https://fleet-server.example.com:8220"}'
Request example
Migrate multiple agents to another cluster
{
  "agents": [
    "agent-id-1",
    "agent-id-2"
  ],
  "enrollment_token": "enrollment-token-value",
  "settings": {
    "retry_max": 5
  },
  "uri": "https://fleet-server.example.com:8220"
}
Response examples (200)
Bulk agent migration initiated
{
  "actionId": "action-id-1"
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}