Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›REST APIs ›Machine learning anomaly detection APIs

Update model snapshots API

New API reference

For the most up-to-date API details, refer to Machine learning anomaly detection APIs.

Updates certain properties of a snapshot.

Request

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

Prerequisites

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

Path parameters

<job_id>
(Required, string) Identifier for the anomaly detection 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
(Optional, string) A description of the model snapshot.
retain
(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.

Examples

resp = client.ml.update_model_snapshot(
    job_id="it_ops_new_logs",
    snapshot_id="1491852978",
    description="Snapshot 1",
    retain=True,
)
print(resp)
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
const response = await client.ml.updateModelSnapshot({
  job_id: "it_ops_new_logs",
  snapshot_id: 1491852978,
  description: "Snapshot 1",
  retain: true,
});
console.log(response);
POST
_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
{
  "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
  }
}

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-update-snapshot.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API