data-attribute-recommendation-python-sdk icon indicating copy to clipboard operation
data-attribute-recommendation-python-sdk copied to clipboard

Implement ModelManagerClient.delete_job_by_model_name

Open mhaas opened this issue 5 years ago • 0 comments

To be able to re-use a model name, we need to delete both the Model resource and the Job ressource. If the Model resource has been deleted, it is not easy to find the job which is blocking the model name.

We should thus implement a delete_job_by_model_name method which does something like this:

all_jobs = model_manager.read_job_collection()

for job in all_jobs["jobs"]:
    if job["modelName"] == model_name:
        model_manager.delete_job_by_id(job["id"])

mhaas avatar Sep 21 '20 15:09 mhaas