Update a snapshot Generally available; Added in 5.4.0

POST /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update

Updates certain properties of a snapshot.

Required authorization

  • Cluster privileges: manage_ml

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

  • snapshot_id string Required

    Identifier for the model snapshot.

application/json

Body Required

  • description string

    A description of the model snapshot.

  • retain 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.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • acknowledged boolean Required
    • model object Required
      Hide model attributes Show model attributes object
      • description string

        An optional description of the job.

      • job_id string Required
      • latest_record_time_stamp number

        The timestamp of the latest processed record.

      • latest_result_time_stamp number

        The timestamp of the latest bucket result.

      • min_version string Required
      • model_size_stats object
        Hide model_size_stats attributes Show model_size_stats attributes object
        • bucket_allocation_failures_count number Required
        • job_id string Required
        • log_time string | number Required

          A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

          One of:

          Time unit for milliseconds

        • memory_status string Required

          Values are ok, soft_limit, or hard_limit.

        • model_bytes number | string Required

        • model_bytes_exceeded number | string

        • model_bytes_memory_limit number | string

        • output_memory_allocator_bytes number | string

        • peak_model_bytes number | string

        • assignment_memory_basis string
        • result_type string Required
        • total_by_field_count number Required
        • total_over_field_count number Required
        • total_partition_field_count number Required
        • categorization_status string Required

          Values are ok or warn.

        • categorized_doc_count number Required
        • dead_category_count number Required
        • failed_category_count number Required
        • frequent_category_count number Required
        • rare_category_count number Required
        • total_category_count number Required
        • timestamp number
      • retain boolean Required

        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.

      • snapshot_doc_count number Required

        For internal use only.

      • snapshot_id string Required
      • timestamp number Required

        The creation timestamp for the snapshot.

POST /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_update
POST
_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
{
  "description": "Snapshot 1",
  "retain": true
}
resp = client.ml.update_model_snapshot(
    job_id="it_ops_new_logs",
    snapshot_id="1491852978",
    description="Snapshot 1",
    retain=True,
)
const response = await client.ml.updateModelSnapshot({
  job_id: "it_ops_new_logs",
  snapshot_id: 1491852978,
  description: "Snapshot 1",
  retain: true,
});
response = client.ml.update_model_snapshot(
  job_id: "it_ops_new_logs",
  snapshot_id: "1491852978",
  body: {
    "description": "Snapshot 1",
    "retain": true
  }
)
$resp = $client->ml()->updateModelSnapshot([
    "job_id" => "it_ops_new_logs",
    "snapshot_id" => "1491852978",
    "body" => [
        "description" => "Snapshot 1",
        "retain" => true,
    ],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"description":"Snapshot 1","retain":true}' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update"
Request example
An example body for a `POST` request.
_ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
{
  "description": "Snapshot 1",
  "retain": true
}