Delete your deployment when you no longer need it to free up resources. You can delete a deployment from a deployment space, or programmatically, by using the Python client or watsonx.ai Runtime APIs.
Before you begin
You must set up your task credentials by generating an API key. For more information, see Managing task credentials.
Deleting a deployment from a space
To remove a deployment:
- Open the Deployments page of your deployment space.
- Choose Delete from the action menu for the deployment name.
Deleting a deployment programmatically
You can delete a deployment programmatically by using the watsonx.ai Python client library, watsonx.ai Runtime API, or CPDCTL.
Deleting a deployment by using the Python client
Use the following method to delete the deployment.
client.deployments.delete(deployment_uid)
Returns a
message. To check that the deployment was removed, you can list deployments and make sure that the deleted deployment is no longer listed.SUCCESS
client.deployments.list()
Returns:
GUID NAME STATE CREATED ARTIFACT_TYPE
Deleting a deployment by using the REST API
Use the
method for deleting a deployment.DELETE
DELETE /ml/v4/deployments/{deployment_id}
For more information, see Delete.
For example, see the following code snippet:
curl --location --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01'
Deleting a deployment by using CPDCTL
You can delete your deployment space by using the
command in CPDCTL and passing your deployment space ID. For more information, see CPDCTL command reference.ml deployment delete
Parent topic: Managing predictive deployments