upgrade-job-model-snapshot.asciidoc 2.6 KB

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