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