Update model snapshots APIedit

Updates certain properties of a snapshot.


POST _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update


Requires the manage_ml cluster privilege. This privilege is included in the machine_learning_admin built-in role.

Path parametersedit

(Required, string) Identifier for the anomaly detection job.
(Required, string) Identifier for the model snapshot.

Request bodyedit

The following properties can be updated after the model snapshot is created:

(Optional, string) A description of the model snapshot.
(Optional, Boolean) If true, this snapshot will not be deleted during automatic cleanup of snapshots older than model_snapshot_retention_days. However, this snapshot will be deleted when the job is deleted. The default value is false.


response = client.ml.update_model_snapshot(
  job_id: 'it_ops_new_logs',
  snapshot_id: 1_491_852_978,
  body: {
    description: 'Snapshot 1',
    retain: true
puts response
  "description": "Snapshot 1",
  "retain": true

When the snapshot is updated, you receive the following results:

  "acknowledged": true,
  "model": {
    "job_id": "it_ops_new_logs",
    "timestamp": 1491852978000,
    "description": "Snapshot 1",
    "retain": true