upgrade-job-model-snapshot.asciidoc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. [[ml-upgrade-job-model-snapshot-query-parms]]
  34. == {api-query-parms-title}
  35. `timeout`::
  36. (Optional, time) Controls the time to wait for the request to complete. The
  37. default value is 30 minutes.
  38. `wait_for_completion`::
  39. (Optional, boolean) When true, the API won't respond until the upgrade is
  40. complete. Otherwise, it responds as soon as the upgrade task is assigned to a
  41. node. Default is false.
  42. [[ml-upgrade-job-model-snapshot-response-body]]
  43. == {api-response-body-title}
  44. `node`::
  45. (string) The ID of the assigned node for the upgrade task if it is still running.
  46. `completed`::
  47. (boolean) When true, this means the task is complete. When false, it is still running.
  48. [[ml-upgrade-job-model-snapshot-example]]
  49. == {api-examples-title}
  50. [source,console]
  51. --------------------------------------------------
  52. POST _ml/anomaly_detectors/low_request_rate/model_snapshots/1828371/_upgrade?timeout=45m&wait_for_completion=true
  53. --------------------------------------------------
  54. // TEST[skip:Kibana sample data]
  55. When the snapshot upgrade starts, you receive the following results:
  56. [source,console-result]
  57. ----
  58. {
  59. "completed" : false,
  60. "node" : "node-1"
  61. }
  62. ----