delete_model

MachineLearningApi.delete_model(model_id, role_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Delete a registered ML model

Deletes the Amorphic ML model. Custom models (IsSubscribedModel no) also delete the SageMaker model. Subscribed models are untagged instead. Owner access is required. Blocked when data pipelines depend on the model.

Parameters:
  • model_id (str) – ModelId of the registered ML model to delete. (required)

  • role_id (str) – Role identifier used for authorization. Missing this header returns AUTH-1001. (required)

  • _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:

ModelDeleteResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: DELETE /models/{model_id}

Success (HTTP 200)

Model deleted. Message is Successfully deleted model.

Request / response example

{
  "Message": "Successfully deleted model"
}

Errors

Documented error codes: IPV-1002, GE-1008.

HTTP 400

Model not found (IPV-1002), caller is not owner, or data pipelines still depend on the model.

Unknown ModelId

{
  "Message": "IPV-1002 - Invalid Model - 7f3a2c1e-9b44-4d21-8c0a-1a2b3c4d5e6f, resource not found."
}

Caller is not the model owner

{
  "Message": "User is not authorized to delete"
}

Data pipelines still reference the model

{
  "Message": "There are data pipelines that depend on the model, remove the dependency to delete the model",
  "DependentResources": [
    {
      "ResourceType": "DataPipelines",
      "Resources": [
        {
          "DataPipelineId": "a1b2c3d4-1111-2222-3333-444455556666",
          "DataPipelineName": "sales-score-pipeline"
        }
      ]
    }
  ]
}

HTTP 500

Unexpected failure while deleting the model (GE-1008).

Request / response example

{
  "Message": "GE-1008 - Could not complete the request. Please try again."
}