data-attribute-recommendation-python-sdk
data-attribute-recommendation-python-sdk copied to clipboard
Implement ModelManagerClient.delete_job_by_model_name
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"])