Spaces method and path for this operation:
post /s/{space_id}/api/fleet/agents/{agentId}/migrate
Refer to Spaces for more information.
Migrate a single agent to another cluster.
[Required authorization] Route required privileges: fleet-agents-all.
POST
/api/fleet/agents/{agentId}/migrate
curl \
--request POST 'https://localhost:5601/api/fleet/agents/{agentId}/migrate' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '"{\n \"enrollment_token\": \"enrollment-token-value\",\n \"settings\": {\n \"retry_max\": 5\n },\n \"uri\": \"https://fleet-server.example.com:8220\"\n}"'
Request example
Migrate a single agent to another cluster
{
"enrollment_token": "enrollment-token-value",
"settings": {
"retry_max": 5
},
"uri": "https://fleet-server.example.com:8220"
}
Response examples (200)
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
}