Delete Agent API
Introduced 2.13
You can use this API to delete an agent based on the agent_id.
Endpoints
DELETE /_plugins/_ml/agents/{agent_id}
Example request
DELETE /_plugins/_ml/agents/MzcIJX8BA7mbufL6DOwl
Example response
{
"_index" : ".plugins-ml-agent",
"_id" : "MzcIJX8BA7mbufL6DOwl",
"_version" : 2,
"result" : "deleted",
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"_seq_no" : 27,
"_primary_term" : 18
}
Error responses
If you attempt to delete an agent that doesn’t exist, OpenSearch returns a 404 error:
{
"error": {
"root_cause": [
{
"type": "status_exception",
"reason": "Fail to find ml agent"
}
],
"type": "status_exception",
"reason": "Fail to find ml agent"
},
"status": 404
}