2017-04-11 21:52:47 -04:00
|
|
|
//lcawley Verified example output 2017-04-11
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-update-snapshot]]
|
|
|
|
==== Update Model Snapshots
|
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The update model snapshot API enables you to update certain properties of a snapshot.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Request
|
|
|
|
|
|
|
|
`POST _xpack/ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
|
|
|
|
|
2017-04-11 16:25:38 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Description
|
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
//TBD. Is the following still true? - not sure but close/open would be the method
|
2017-04-11 16:25:38 -04:00
|
|
|
Updates to the configuration are only applied after the job has been closed
|
2017-04-24 12:31:31 -04:00
|
|
|
and re-opened.
|
2017-04-11 16:25:38 -04:00
|
|
|
|
2017-04-18 18:13:21 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Path Parameters
|
|
|
|
|
|
|
|
`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
|
|
|
|
|
|
|
===== Request Body
|
|
|
|
|
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
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
===== Authorization
|
|
|
|
|
|
|
|
You must have `manage_ml`, or `manage` cluster privileges to use this API.
|
|
|
|
For more information, see <<privileges-list-cluster>>.
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Examples
|
|
|
|
|
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
|
|
|
|
_xpack/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
|
|
|
}
|
|
|
|
----
|