mb.restart_deployment(name, ...)
Restart a running deployment to ensure its initialization code (e.g. imports and code outside the inference function) are re-executed.
Parameters
name
:str
The name of the deployment.version
:Optional[str,'latest']
The version to restart. The version can be the integer version of the deployment, orlatest
. If no version is specified thenlatest
is used.branch
:Optional[str]
The branch of the deployment and version. If not specified then the current branch is used. By default that ismain
.
Returns
No value is returned. A success status message is printed if the command is successful.
Examples
Restart the latest version of a deployment
mb.restart_deployment("example_deployment")
Restart a specific version and branch of a deployment
mb.restart_deployment("example_deployment", version=5, branch="dev")