IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Get model snapshots API
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Get model snapshots API
editRetrieves information about model snapshots.
Request
editGET _ml/anomaly_detectors/<job_id>/model_snapshots
GET _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>
Path Parameters
edit-
job_id
- (string) Identifier for the job.
-
snapshot_id
- (string) Identifier for the model snapshot. If you do not specify this optional parameter, the API returns information about all model snapshots.
Request Body
edit-
desc
- (boolean) If true, the results are sorted in descending order.
-
end
- (date) Returns snapshots with timestamps earlier than this time.
-
from
- (integer) Skips the specified number of snapshots.
-
size
- (integer) Specifies the maximum number of snapshots to obtain.
-
sort
- (string) Specifies the sort field for the requested snapshots. By default, the snapshots are sorted by their timestamp.
-
start
- (string) Returns snapshots with timestamps after this time.
Results
editThe API returns the following information:
-
model_snapshots
- (array) An array of model snapshot objects. For more information, see Model Snapshots.
Authorization
editYou must have monitor_ml
, monitor
, manage_ml
, or manage
cluster
privileges to use this API. For more information, see
Security privileges.
Examples
editGET _ml/anomaly_detectors/farequote/model_snapshots { "start": "1491852977000" }
In this example, the API provides a single result:
{ "count": 1, "model_snapshots": [ { "job_id": "farequote", "min_version": "6.3.0", "timestamp": 1491948163000, "description": "State persisted due to job close at 2017-04-11T15:02:43-0700", "snapshot_id": "1491948163", "snapshot_doc_count": 1, "model_size_stats": { "job_id": "farequote", "result_type": "model_size_stats", "model_bytes": 387594, "total_by_field_count": 21, "total_over_field_count": 0, "total_partition_field_count": 20, "bucket_allocation_failures_count": 0, "memory_status": "ok", "log_time": 1491948163000, "timestamp": 1455234600000 }, "latest_record_time_stamp": 1455235196000, "latest_result_time_stamp": 1455234900000, "retain": false } ] }
Was this helpful?
Thank you for your feedback.