update-snapshot.asciidoc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-prereqs]]
  13. == {api-prereq-title}
  14. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  15. `manage` cluster privileges to use this API. See
  16. <<security-privileges>> and {ml-docs-setup-privileges}.
  17. [[ml-update-snapshot-path-parms]]
  18. == {api-path-parms-title}
  19. `<job_id>`::
  20. (Required, string)
  21. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  22. `<snapshot_id>`::
  23. (Required, string)
  24. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=snapshot-id]
  25. [[ml-update-snapshot-request-body]]
  26. == {api-request-body-title}
  27. The following properties can be updated after the model snapshot is created:
  28. `description`::
  29. (Optional, string) A description of the model snapshot.
  30. `retain`::
  31. (Optional, boolean)
  32. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=retain]
  33. [[ml-update-snapshot-example]]
  34. == {api-examples-title}
  35. [source,console]
  36. --------------------------------------------------
  37. POST
  38. _ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
  39. {
  40. "description": "Snapshot 1",
  41. "retain": true
  42. }
  43. --------------------------------------------------
  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. ----