[[reference-ml-upgrade_job_snapshot]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
=== client.ml.upgradeJobSnapshot

Upgrade a snapshot. Upgrades an anomaly detection model snapshot to the latest major version. Over time, older snapshot formats are deprecated and removed. Anomaly detection jobs support only snapshots that are from the current or previous major version. This API provides a means to upgrade a snapshot to the current major version. This aids in preparing the cluster for an upgrade to the next major version. Only one snapshot per anomaly detection job can be upgraded at a time and the upgraded snapshot cannot be the current snapshot of the anomaly detection job.

{ref}/ml-upgrade-job-model-snapshot.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(MlUpgradeJobSnapshotRequest, options?): Promise<MlUpgradeJobSnapshotResponse>
----

[discrete]
===== `MlUpgradeJobSnapshotRequest`

[source,ts]
----
interface MlUpgradeJobSnapshotRequest extends <<RequestBase>> {
  job_id: <<Id>>
  snapshot_id: <<Id>>
  wait_for_completion?: boolean
  timeout?: <<Duration>>
}
----

[discrete]
===== `MlUpgradeJobSnapshotResponse`

[source,ts]
----
interface MlUpgradeJobSnapshotResponse {
  node: <<NodeId>>
  completed: boolean
}
----

