2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-update-snapshot]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Update model snapshots API
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Update model snapshots</titleabbrev>
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-06-13 16:37:35 -04:00
|
|
|
Updates certain properties of a snapshot.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-snapshot-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`POST _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
[[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
|
2019-10-07 18:23:19 -04:00
|
|
|
<<security-privileges>>.
|
2019-06-27 16:58:42 -04:00
|
|
|
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-snapshot-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<job_id>`::
|
2019-12-27 16:30:26 -05:00
|
|
|
(Required, string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<snapshot_id>`::
|
2019-12-31 13:53:05 -05:00
|
|
|
(Required, string)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=snapshot-id]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-snapshot-request-body]]
|
|
|
|
==== {api-request-body-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 16:25:38 -04:00
|
|
|
The following properties can be updated after the model snapshot is created:
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`description`::
|
2019-12-31 13:53:05 -05:00
|
|
|
(Optional, string) A description of the model snapshot.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`retain`::
|
2019-12-31 13:53:05 -05:00
|
|
|
(Optional, boolean)
|
2020-06-01 16:46:15 -04:00
|
|
|
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=retain]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-snapshot-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2017-04-04 18:26:39 -04:00
|
|
|
--------------------------------------------------
|
2017-04-11 16:25:38 -04:00
|
|
|
POST
|
2018-12-07 15:34:11 -05:00
|
|
|
_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2017-04-11 16:25:38 -04:00
|
|
|
"description": "Snapshot 1",
|
|
|
|
"retain": true
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
2017-04-11 16:25:38 -04:00
|
|
|
When the snapshot is updated, you receive the following results:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
2017-04-11 16:25:38 -04:00
|
|
|
"acknowledged": true,
|
|
|
|
"model": {
|
|
|
|
"job_id": "it_ops_new_logs",
|
|
|
|
"timestamp": 1491852978000,
|
|
|
|
"description": "Snapshot 1",
|
|
|
|
...
|
|
|
|
"retain": true
|
|
|
|
}
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
----
|