update-snapshot.asciidoc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. [role="xpack"]
  2. [[ml-update-snapshot]]
  3. === Update Model Snapshots API
  4. ++++
  5. <titleabbrev>Update Model Snapshots</titleabbrev>
  6. ++++
  7. Updates certain properties of a snapshot.
  8. ==== Request
  9. `POST _xpack/ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
  10. //==== Description
  11. ==== Path Parameters
  12. `job_id` (required)::
  13. (string) Identifier for the job
  14. `snapshot_id` (required)::
  15. (string) Identifier for the model snapshot
  16. ==== Request Body
  17. The following properties can be updated after the model snapshot is created:
  18. `description`::
  19. (string) An optional description of the model snapshot. For example,
  20. "Before black friday".
  21. `retain`::
  22. (boolean) If true, this snapshot will not be deleted during automatic cleanup
  23. of snapshots older than `model_snapshot_retention_days`.
  24. Note that this snapshot will still be deleted when the job is deleted.
  25. The default value is false.
  26. ==== Authorization
  27. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  28. For more information, see
  29. {xpack-ref}/security-privileges.html[Security Privileges].
  30. //<<privileges-list-cluster>>.
  31. ==== Examples
  32. The following example updates the snapshot identified as `1491852978`:
  33. [source,js]
  34. --------------------------------------------------
  35. POST
  36. _xpack/ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
  37. {
  38. "description": "Snapshot 1",
  39. "retain": true
  40. }
  41. --------------------------------------------------
  42. // CONSOLE
  43. // TEST[skip:todo]
  44. When the snapshot is updated, you receive the following results:
  45. [source,js]
  46. ----
  47. {
  48. "acknowledged": true,
  49. "model": {
  50. "job_id": "it_ops_new_logs",
  51. "timestamp": 1491852978000,
  52. "description": "Snapshot 1",
  53. ...
  54. "retain": true
  55. }
  56. }
  57. ----