update-snapshot.asciidoc 1.7 KB

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