update-snapshot.asciidoc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. Requires the `manage_ml` cluster privilege. This privilege is included in the
  15. `machine_learning_admin` built-in role.
  16. [[ml-update-snapshot-path-parms]]
  17. == {api-path-parms-title}
  18. `<job_id>`::
  19. (Required, string)
  20. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  21. `<snapshot_id>`::
  22. (Required, string)
  23. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=snapshot-id]
  24. [[ml-update-snapshot-request-body]]
  25. == {api-request-body-title}
  26. The following properties can be updated after the model snapshot is created:
  27. `description`::
  28. (Optional, string) A description of the model snapshot.
  29. `retain`::
  30. (Optional, Boolean)
  31. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=retain]
  32. [[ml-update-snapshot-example]]
  33. == {api-examples-title}
  34. [source,console]
  35. --------------------------------------------------
  36. POST
  37. _ml/anomaly_detectors/it_ops_new_logs/model_snapshots/1491852978/_update
  38. {
  39. "description": "Snapshot 1",
  40. "retain": true
  41. }
  42. --------------------------------------------------
  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. ----