OpenSearch/docs/en/rest-api/ml/update-snapshot.asciidoc

77 lines
1.7 KiB
Plaintext

[[ml-update-snapshot]]
==== Update Model Snapshots
The update model snapshot API allows you to update certain properties of a snapshot.
===== Request
`POST _xpack/ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
===== Description
//TBD. Is the following still true?
Updates to the configuration are only applied after the job has been closed
and new data has been sent to it.
===== Path Parameters
`job_id` (required)::
(+string+) Identifier for the job
`snapshot_id` (required)::
(+string+) Identifier for the model snapshot
===== Request Body
The following properties can be updated after the model snapshot is created:
`description`::
(+string+) An optional description of the model snapshot.
`retain`::
(+boolean+) TBD.
////
===== Responses
TBD
200
(EmptyResponse) The cluster has been successfully deleted
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: clusters.cluster_not_found)
412
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet (code: clusters.cluster_plan_state_error)
////
===== Examples
The following example updates the snapshot identified as `1491852978`:
[source,js]
--------------------------------------------------
POST
_xpack/ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
{
"description": "Snapshot 1",
"retain": true
}
--------------------------------------------------
// CONSOLE
// TEST[skip:todo]
When the snapshot is updated, you receive the following results:
----
{
"acknowledged": true,
"model": {
"job_id": "it_ops_new_logs",
"timestamp": 1491852978000,
"description": "Snapshot 1",
...
"retain": true
}
}
----