update-snapshot.asciidoc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. [[ml-update-snapshot-request]]
  9. == {api-request-title}
  10. `POST _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_update`
  11. [[ml-update-snapshot-prereqs]]
  12. == {api-prereq-title}
  13. Requires the `manage_ml` cluster privilege. This privilege is included in the
  14. `machine_learning_admin` built-in role.
  15. [[ml-update-snapshot-path-parms]]
  16. == {api-path-parms-title}
  17. `<job_id>`::
  18. (Required, string)
  19. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  20. `<snapshot_id>`::
  21. (Required, string)
  22. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=snapshot-id]
  23. [[ml-update-snapshot-request-body]]
  24. == {api-request-body-title}
  25. The following properties can be updated after the model snapshot is created:
  26. `description`::
  27. (Optional, string) A description of the model snapshot.
  28. `retain`::
  29. (Optional, Boolean)
  30. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=retain]
  31. [[ml-update-snapshot-example]]
  32. == {api-examples-title}
  33. [source,console]
  34. --------------------------------------------------
  35. POST
  36. _ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
  37. {
  38. "description": "Snapshot 1",
  39. "retain": true
  40. }
  41. --------------------------------------------------
  42. // TEST[skip:todo]
  43. When the snapshot is updated, you receive the following results:
  44. [source,js]
  45. ----
  46. {
  47. "acknowledged": true,
  48. "model": {
  49. "job_id": "it_ops_new_logs",
  50. "timestamp": 1491852978000,
  51. "description": "Snapshot 1",
  52. ...
  53. "retain": true
  54. }
  55. }
  56. ----