update_model¶
- MachineLearningApi.update_model(model_id, role_id, model_put_data, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Update registered ML model metadata
Updates model metadata in DynamoDB. Does not change SageMaker artifacts or AlgorithmUsed. Requires owner or editor access. AlgorithmUsed must be present in the body even though it is not applied.
- Parameters:
model_id (str) – ModelId of the registered ML model to update. (required)
role_id (str) – Role identifier used for authorization. Missing this header returns AUTH-1001. (required)
model_put_data (ModelPutData) – (required)
content_type (str)
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: PUT /models/{model_id}
Request¶
Request / response example
{
"ModelName": "sales-blazingtext",
"Description": "Updated sentiment classifier",
"OutputType": "metadata",
"AlgorithmUsed": "BlazingText",
"SupportedFileFormats": [
"csv",
"txt"
],
"PreProcessedGlueJobs": "custom_role_job",
"PostProcessedGlueJobs": "custom_role_job",
"Keywords": [
"nlp",
"reviews"
]
}
Success (HTTP 200)¶
Metadata updated. Message is Updated successfully.
Request / response example
{
"Message": "Updated successfully",
"ModelId": "7f3a2c1e-9b44-4d21-8c0a-1a2b3c4d5e6f"
}
Errors¶
Documented error codes: GE-1001, IPV-1002, IPV-1018, GE-1008.
HTTP 400
Empty body (GE-1001), model not found (IPV-1002), duplicate ModelName (IPV-1018), or caller is not owner/editor.
Empty request body
{
"Message": "GE-1001 - Invalid input body"
}
Unknown ModelId
{
"Message": "IPV-1002 - Invalid Model - 7f3a2c1e-9b44-4d21-8c0a-1a2b3c4d5e6f, resource not found."
}
Caller is not owner or editor
{
"Message": "User is not authorized to edit"
}
HTTP 500
DynamoDB update failed (Message Error updating model) or unexpected error (GE-1008).
Request / response example
{
"Message": "Error updating model",
"ModelId": "7f3a2c1e-9b44-4d21-8c0a-1a2b3c4d5e6f"
}