upgrade-job-model-snapshot.asciidoc 2.5 KB

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