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]]
|
2018-12-21 02:23:28 +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]]
|
|
|
|
==== {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]]
|
|
|
|
==== {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-05 07:10:26 +08:00
|
|
|
<<security-privileges>>.
|
2019-06-28 04:58:42 +08:00
|
|
|
|
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-update-snapshot-path-parms]]
|
|
|
|
==== {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)
|
|
|
|
include::{docdir}/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>`::
|
|
|
|
(Required, string) Identifier for the model snapshot.
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-update-snapshot-request-body]]
|
|
|
|
==== {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`::
|
|
|
|
(Optional, string) A description of the model snapshot. For example,
|
2017-04-25 01:46:17 +08:00
|
|
|
"Before black friday".
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-07-12 23:26:31 +08:00
|
|
|
`retain`::
|
|
|
|
(Optional, boolean) If true, this snapshot will not be deleted during
|
|
|
|
automatic cleanup of snapshots older than `model_snapshot_retention_days`.
|
2019-08-07 02:05:01 +08:00
|
|
|
Note that this snapshot will still be deleted when the {anomaly-job} is
|
|
|
|
deleted. The default value is false.
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-update-snapshot-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2017-04-12 04:25:38 +08:00
|
|
|
The following example updates the snapshot identified as `1491852978`:
|
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
|
|
|
}
|
|
|
|
----
|