Revert to a snapshot Added in 5.4.0

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

The machine learning features react quickly to anomalous input, learning new behaviors in data. Highly anomalous input increases the variance in the models whilst the system learns whether this is a new step-change in behavior or a one-off event. In the case where this anomalous input is known to be a one-off, then it might be appropriate to reset the model state to a time before this event. For example, you might consider reverting to a saved snapshot after Black Friday or a critical system failure.

Path parameters

  • job_id string Required

    Identifier for the anomaly detection job.

  • snapshot_id string Required

    You can specify empty as the . Reverting to the empty snapshot means the anomaly detection job starts learning a new model from scratch when it is started.

Query parameters

  • If true, deletes the results in the time period between the latest results and the time of the reverted snapshot. It also resets the model to accept records for this time period. If you choose not to delete intervening results when reverting a snapshot, the job will not accept input data that is older than the current time. If you want to resend data, then delete the intervening results.

application/json

Body

Responses

POST /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert
curl \
 -X POST http://api.example.com/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert \
 -H "Content-Type: application/json" \
 -d '{"delete_intervening_results":true}'
Request examples
{
  "delete_intervening_results": true
}
Response examples (200)
{
  "model": {
    "description": "string",
    "job_id": "string",
    "latest_record_time_stamp": 42.0,
    "latest_result_time_stamp": 42.0,
    "min_version": "string",
    "model_size_stats": {
      "bucket_allocation_failures_count": 42.0,
      "job_id": "string",
      "": 42.0,
      "memory_status": "ok",
      "assignment_memory_basis": "string",
      "result_type": "string",
      "total_by_field_count": 42.0,
      "total_over_field_count": 42.0,
      "total_partition_field_count": 42.0,
      "categorization_status": "ok",
      "categorized_doc_count": 42.0,
      "dead_category_count": 42.0,
      "failed_category_count": 42.0,
      "frequent_category_count": 42.0,
      "rare_category_count": 42.0,
      "total_category_count": 42.0,
      "timestamp": 42.0
    },
    "retain": true,
    "snapshot_doc_count": 42.0,
    "snapshot_id": "string",
    "timestamp": 42.0
  }
}