78 lines
1.8 KiB
Plaintext
78 lines
1.8 KiB
Plaintext
//lcawley Verified example output 2017-04-11
|
|
[[ml-update-snapshot]]
|
|
==== Update Model Snapshots
|
|
|
|
The update model snapshot API enables you to update certain properties of a snapshot.
|
|
|
|
===== Request
|
|
|
|
`POST _xpack/ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
|
|
|
|
|
|
===== Description
|
|
|
|
//TBD. Is the following still true? - not sure but close/open would be the method
|
|
Updates to the configuration are only applied after the job has been closed
|
|
and re-opened.
|
|
|
|
|
|
===== Path Parameters
|
|
|
|
`job_id` (required)::
|
|
(string) Identifier for the job
|
|
|
|
`snapshot_id` (required)::
|
|
(string) Identifier for the model snapshot
|
|
|
|
===== Request Body
|
|
|
|
The following properties can be updated after the model snapshot is created:
|
|
|
|
`description`::
|
|
(string) An optional description of the model snapshot. For example,
|
|
"Before black friday".
|
|
|
|
`retain`::
|
|
(boolean) If true, this snapshot will not be deleted during automatic cleanup
|
|
of snapshots older than `model_snapshot_retention_days`.
|
|
Note that this snapshot will still be deleted when the job is deleted.
|
|
The default value is false.
|
|
|
|
|
|
===== Authorization
|
|
|
|
You must have `manage_ml`, or `manage` cluster privileges to use this API.
|
|
For more information, see <<privileges-list-cluster>>.
|
|
|
|
|
|
===== Examples
|
|
|
|
The following example updates the snapshot identified as `1491852978`:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
POST
|
|
_xpack/ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
|
|
{
|
|
"description": "Snapshot 1",
|
|
"retain": true
|
|
}
|
|
--------------------------------------------------
|
|
// CONSOLE
|
|
// TEST[skip:todo]
|
|
|
|
When the snapshot is updated, you receive the following results:
|
|
[source,js]
|
|
----
|
|
{
|
|
"acknowledged": true,
|
|
"model": {
|
|
"job_id": "it_ops_new_logs",
|
|
"timestamp": 1491852978000,
|
|
"description": "Snapshot 1",
|
|
...
|
|
"retain": true
|
|
}
|
|
}
|
|
----
|