Update online deployment API
You can use this API to update an existing online deployment’s metadata.
HTTP method and URI path
PATCH /v3/published_models/{published_model_id}/deployments/{deployment_id}
Standard headers
Use the following standard HTTP header with this request:
Content-Type: application/json
Authorization: <Bearer token>
Required authorizations
The user ID associated with the token which is specified in the request header needs to be granted with one of the following roles:
- sysadm
- mladm
- apiuser (only if the deployment was created by the user)
Request body
| Parameter | Type | Required or optional | Description |
|---|---|---|---|
| op | String | Required |
Specify the operation of the update. Set to Set to |
| path | String | Required |
Specify the paths of the fields to be updated. The supported fields for op
Note: With the
" /deploy_info/timeout " optional input, you can:
|
| value | JSON object | Optional | Specify the values for the updated fields. For example, for artifactVersionHref update, users can specify the value for artifactVersionHref as the following:
|
Example of request body:
Update the deployment with another model version
[
{
"op": "replace",
"path": "/deploy_info/artifactVersionHref",
"value": "/v3/ml_assets/models/7710a037-91b4-46b7-a00d-dc82dae085a9/versions/46c21a5c-0576-41e7-a6ee-b2a4af6dad35"
}
]
In this example, we update the existing deployment with a new model version. The request body indicates the artifactVersionHref field will be updated. The updated value is the model version href.
Expected response
On completion, the service returns an HTTP response, which includes a status code that indicates whether your request is completed. Status code 200 indicates a successful completion. The response from a successful request returns the completed updated model version metadata. See the Get deployment detail API for the response details.
HTTP status codes
For unsuccessful requests, the service returns the status codes that are described in Table 2.
| HTTP status code | Error response | Description |
|---|---|---|
| 400 | patch_path_not_allowed | Path is not allowed in the request body. Check the supported path list in the introduction of request body for path. |
| 400 | path_error | The value specified for patch is not valid for the new metadata json fields. Check the value. |
| 400 | Duplicate deployment name | The deployment name already exists. Select another name. |
| 400 | Invalid model version href | The model version href is invalid. |
| 400 | timeout_not_supported | The timeout value must be an integer greater than 0 and is supported only for the online deployment type with the PMML engine only. |
| 500 | Update failed | Failed to update the deployment. |
Machine Learning for IBM z/OS® delivers exceptional throughput and performance for inferencing tasks. However, in rare scenarios, an inferencing request may take longer than expected. To handle this, use the scoring timeout option to cancel the long-running inferencing requests automatically.
Set a reasonable timeout value. A low timeout might reject most incoming inferencing requests, causing real-time online scoring failures.
Timeout introduces a minor performance overhead. Enable it only when necessary.