This API is used to delete a model based on the model ID. When cascade is set to true, the model specified by the model ID and models of different versions with the same name as the specified model are deleted. By default, only the model with the specified model ID is deleted.
DELETE /v1/{project_id}/models/{model_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
model_id |
Yes |
String |
ID of the model to be deleted |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
cascade |
No |
Boolean |
The default value is false, indicating that only the model with the specified model ID is deleted. The value true indicates that not only the model with the specified model ID but also all models with the same name but different versions as the specified model will be deleted. A maximum of 20 models can be deleted at a time. |
None
The following shows how to delete the model whose ID is 023e90be-7e2a-4169-bab4-1bc34ff0ca45 and all models of the same name but different versions.
DELETE https://endpoint/v1/{project_id}/models/023e90be-7e2a-4169-bab4-1bc34ff0ca45?cascade=true
{ "delete_success_list": ["fc9e88a1-0005-40b3-867e-7aee61449aeb", "f3f3ba0e-f073-454e-9e3f-14b7d786f45e"], "delete_failed_list": [ { "model_id": "759645d9-3672-4db1-bb6d-49ed58b84e10", "error_code": "ModelArts.3009", "error_message": "Failed to delete model, model (759645d9-3672-4db1-bb6d-49ed58b84e10) already deploy service." }] }
For details about the status code, see Table 1.
See Error Codes.