2017-06-19 18:23:58 -07:00
|
|
|
[role="xpack"]
|
2018-08-31 16:49:24 -07:00
|
|
|
[testenv="platinum"]
|
2017-04-04 15:26:39 -07:00
|
|
|
[[ml-update-snapshot]]
|
2017-12-14 10:52:49 -08:00
|
|
|
=== Update Model Snapshots API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Update Model Snapshots</titleabbrev>
|
|
|
|
++++
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2018-06-13 13:37:35 -07:00
|
|
|
Updates certain properties of a snapshot.
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-06-06 13:42:47 -07:00
|
|
|
==== Request
|
2017-04-04 15:26:39 -07:00
|
|
|
|
|
|
|
`POST _xpack/ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
|
|
|
|
|
2017-04-11 13:25:38 -07:00
|
|
|
|
2017-07-27 08:17:17 -07:00
|
|
|
//==== Description
|
2017-04-18 15:13:21 -07:00
|
|
|
|
2017-06-06 13:42:47 -07:00
|
|
|
==== Path Parameters
|
2017-04-04 15:26:39 -07:00
|
|
|
|
|
|
|
`job_id` (required)::
|
2017-04-11 19:26:18 -07:00
|
|
|
(string) Identifier for the job
|
2017-04-04 15:26:39 -07:00
|
|
|
|
|
|
|
`snapshot_id` (required)::
|
2017-04-11 19:26:18 -07:00
|
|
|
(string) Identifier for the model snapshot
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-06-06 13:42:47 -07:00
|
|
|
==== Request Body
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-04-11 13:25:38 -07:00
|
|
|
The following properties can be updated after the model snapshot is created:
|
2017-04-04 15:26:39 -07:00
|
|
|
|
|
|
|
`description`::
|
2017-04-24 10:46:17 -07:00
|
|
|
(string) An optional description of the model snapshot. For example,
|
|
|
|
"Before black friday".
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-04-11 13:25:38 -07:00
|
|
|
`retain`::
|
2017-04-24 10:46:17 -07:00
|
|
|
(boolean) If true, this snapshot will not be deleted during automatic cleanup
|
|
|
|
of snapshots older than `model_snapshot_retention_days`.
|
2017-04-24 17:31:31 +01:00
|
|
|
Note that this snapshot will still be deleted when the job is deleted.
|
|
|
|
The default value is false.
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-04-25 14:08:29 -07:00
|
|
|
|
2017-06-06 13:42:47 -07:00
|
|
|
==== Authorization
|
2017-04-25 14:08:29 -07:00
|
|
|
|
|
|
|
You must have `manage_ml`, or `manage` cluster privileges to use this API.
|
2017-06-19 18:23:58 -07:00
|
|
|
For more information, see
|
|
|
|
{xpack-ref}/security-privileges.html[Security Privileges].
|
|
|
|
//<<privileges-list-cluster>>.
|
2017-04-25 14:08:29 -07:00
|
|
|
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-06-06 13:42:47 -07:00
|
|
|
==== Examples
|
2017-04-04 15:26:39 -07:00
|
|
|
|
2017-04-11 13:25:38 -07:00
|
|
|
The following example updates the snapshot identified as `1491852978`:
|
2017-04-04 15:26:39 -07:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-04-11 13:25:38 -07:00
|
|
|
POST
|
|
|
|
_xpack/ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
|
2017-04-04 15:26:39 -07:00
|
|
|
{
|
2017-04-11 13:25:38 -07:00
|
|
|
"description": "Snapshot 1",
|
|
|
|
"retain": true
|
2017-04-04 15:26:39 -07:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
2017-04-11 13:25:38 -07:00
|
|
|
When the snapshot is updated, you receive the following results:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 15:26:39 -07:00
|
|
|
----
|
|
|
|
{
|
2017-04-11 13:25:38 -07:00
|
|
|
"acknowledged": true,
|
|
|
|
"model": {
|
|
|
|
"job_id": "it_ops_new_logs",
|
|
|
|
"timestamp": 1491852978000,
|
|
|
|
"description": "Snapshot 1",
|
|
|
|
...
|
|
|
|
"retain": true
|
|
|
|
}
|
2017-04-04 15:26:39 -07:00
|
|
|
}
|
|
|
|
----
|