upgrade-job-model-snapshot.asciidoc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-upgrade-job-model-snapshot]]
  4. = Upgrade model snapshots API
  5. ++++
  6. <titleabbrev>Upgrade model snapshots</titleabbrev>
  7. ++++
  8. Upgrades an {anomaly-detect} model snapshot to the latest major version.
  9. [[ml-upgrade-job-model-snapshot-request]]
  10. == {api-request-title}
  11. `POST _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_upgrade`
  12. [[ml-upgrade-job-model-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. * The upgraded snapshot must have a version matching the previous major version.
  17. * The upgraded snapshot must NOT be the current {anomaly-job} snapshot.
  18. [[ml-upgrade-job-model-snapshot-desc]]
  19. == {api-description-title}
  20. Over time, older snapshot formats are deprecated and removed. {anomaly-jobs-cap}
  21. support only snapshots that are from the current or previous major version.
  22. This API provides a means to upgrade a snapshot to the current major version.
  23. This aids in preparing the cluster for an upgrade to the next major version.
  24. Only one snapshot per {anomaly-job} can be upgraded at a time and the upgraded
  25. snapshot cannot be the current snapshot of the {anomaly-job}.
  26. [[ml-upgrade-job-model-snapshot-path-parms]]
  27. == {api-path-parms-title}
  28. `<job_id>`::
  29. (Required, string)
  30. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
  31. `<snapshot_id>`::
  32. (Required, string)
  33. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=snapshot-id]
  34. `timeout`::
  35. (Optional, time) Controls the time to wait for the request to complete. The default
  36. value is 30 minutes.
  37. `wait_for_completion`::
  38. (Optional, boolean) When true, the API won't respond until the upgrade is complete. Otherwise,
  39. it responds as soon as the upgrade task is assigned to a node. Default is false.
  40. [[ml-upgrade-job-model-snapshot-response-body]]
  41. == {api-response-body-title}
  42. `node`::
  43. (string) The ID of the assigned node for the upgrade task if it is still running.
  44. `completed`::
  45. (boolean) When true, this means the task is complete. When false, it is still running.
  46. [[ml-upgrade-job-model-snapshot-example]]
  47. == {api-examples-title}
  48. [source,console]
  49. --------------------------------------------------
  50. POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1828371/_upgrade?timeout=45m&wait_for_completion=true
  51. --------------------------------------------------
  52. // TEST[skip:Kibana sample data]
  53. When the snapshot upgrade starts, you receive the following results:
  54. [source,console-result]
  55. ----
  56. {
  57. "completed" : false,
  58. "node" : "node-1"
  59. }
  60. ----