update-snapshot.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. [[ml-update-snapshot-request]]
  10. ==== {api-request-title}
  11. `POST _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
  12. [[ml-update-snapshot-path-parms]]
  13. ==== {api-path-parms-title}
  14. `job_id` (required)::
  15. (string) Identifier for the job
  16. `snapshot_id` (required)::
  17. (string) Identifier for the model snapshot
  18. [[ml-update-snapshot-request-body]]
  19. ==== {api-request-body-title}
  20. The following properties can be updated after the model snapshot is created:
  21. `description`::
  22. (string) An optional description of the model snapshot. For example,
  23. "Before black friday".
  24. `retain`::
  25. (boolean) If true, this snapshot will not be deleted during automatic cleanup
  26. of snapshots older than `model_snapshot_retention_days`.
  27. Note that this snapshot will still be deleted when the job is deleted.
  28. The default value is false.
  29. [[ml-update-snapshot-prereqs]]
  30. ==== {api-prereq-title}
  31. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  32. For more information, see
  33. {stack-ov}/security-privileges.html[Security privileges].
  34. [[ml-update-snapshot-example]]
  35. ==== {api-examples-title}
  36. The following example updates the snapshot identified as `1491852978`:
  37. [source,js]
  38. --------------------------------------------------
  39. POST
  40. _ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
  41. {
  42. "description": "Snapshot 1",
  43. "retain": true
  44. }
  45. --------------------------------------------------
  46. // CONSOLE
  47. // TEST[skip:todo]
  48. When the snapshot is updated, you receive the following results:
  49. [source,js]
  50. ----
  51. {
  52. "acknowledged": true,
  53. "model": {
  54. "job_id": "it_ops_new_logs",
  55. "timestamp": 1491852978000,
  56. "description": "Snapshot 1",
  57. ...
  58. "retain": true
  59. }
  60. }
  61. ----