Delete Evaluation Target#

To delete an evaluation target, send a DELETE request to the targets endpoint. You must provide both the namespace and ID of the target as shown in the following code.

Caution

Before you delete a target, ensure that no jobs use it. If a job uses the target, you must delete the job first.To find all jobs that use a target, refer to Example: Filter Jobs by Target.

To Delete an Evaluation Target#

Choose one of the following options to delete an evaluation target.

import os
from nemo_microservices import NeMoMicroservices

# Initialize the client
client = NeMoMicroservices(
    base_url=os.environ['EVALUATOR_BASE_URL']
)

# Delete an evaluation target
response = client.evaluation.targets.delete(
    namespace="my-namespace",
    target_name="my-target-id"
)

print(f"Target deleted: {response.message}")
print(f"Deleted at: {response.deleted_at}")
curl -X "DELETE" "${EVALUATOR_BASE_URL}/evaluation/targets/<my-namespace>/<my-target-id>" \
  -H 'accept: application/json'
Example Response
{
    "message": "Resource deleted successfully.",
    "id": "eval-target-ABCD1234EFGH5678",
    "deleted_at": null
}