OpenSearch/docs/reference/ml/anomaly-detection/apis/update-snapshot.asciidoc

75 lines
1.6 KiB
Plaintext
Raw Normal View History

[role="xpack"]
[testenv="platinum"]
[[ml-update-snapshot]]
2018-12-20 13:23:28 -05:00
=== Update model snapshots API
++++
2018-12-20 13:23:28 -05:00
<titleabbrev>Update model snapshots</titleabbrev>
++++
2018-06-13 16:37:35 -04:00
Updates certain properties of a snapshot.
[[ml-update-snapshot-request]]
==== {api-request-title}
`POST _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
[[ml-update-snapshot-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have `manage_ml` or
`manage` cluster privileges to use this API. See
<<security-privileges>>.
[[ml-update-snapshot-path-parms]]
==== {api-path-parms-title}
`<job_id>`::
(Required, string)
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
`<snapshot_id>`::
(Required, string)
include::{docdir}/ml/ml-shared.asciidoc[tag=snapshot-id]
[[ml-update-snapshot-request-body]]
==== {api-request-body-title}
The following properties can be updated after the model snapshot is created:
`description`::
(Optional, string) A description of the model snapshot.
`retain`::
(Optional, boolean)
include::{docdir}/ml/ml-shared.asciidoc[tag=retain]
[[ml-update-snapshot-example]]
==== {api-examples-title}
[source,console]
--------------------------------------------------
POST
_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
{
"description": "Snapshot 1",
"retain": true
}
--------------------------------------------------
// TEST[skip:todo]
When the snapshot is updated, you receive the following results:
[source,js]
----
{
"acknowledged": true,
"model": {
"job_id": "it_ops_new_logs",
"timestamp": 1491852978000,
"description": "Snapshot 1",
...
"retain": true
}
}
----