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 12:42:47 -04:00
|
|
|
[[ml-update-snapshot-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`job_id` (required)::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Identifier for the job
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`snapshot_id` (required)::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Identifier for the model snapshot
|
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
|
|
|
|
|
|
|
`description`::
|
2017-04-24 13:46:17 -04:00
|
|
|
(string) An optional description of the model snapshot. For example,
|
|
|
|
"Before black friday".
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 16:25:38 -04:00
|
|
|
`retain`::
|
2017-04-24 13:46:17 -04:00
|
|
|
(boolean) If true, this snapshot will not be deleted during automatic cleanup
|
|
|
|
of snapshots older than `model_snapshot_retention_days`.
|
2017-04-24 12:31:31 -04:00
|
|
|
Note that this snapshot will still be deleted when the job is deleted.
|
|
|
|
The default value is false.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-update-snapshot-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
You must have `manage_ml`, or `manage` cluster privileges to use this API.
|
2017-06-19 21:23:58 -04:00
|
|
|
For more information, see
|
2019-06-27 12:42:47 -04:00
|
|
|
{stack-ov}/security-privileges.html[Security privileges].
|
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
|
|
|
|
2017-04-11 16:25:38 -04:00
|
|
|
The following example updates the snapshot identified as `1491852978`:
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
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
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// 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
|
|
|
}
|
|
|
|
----
|