[enh] implement cli cancel

This commit is contained in:
Laurent Peuch 2018-09-03 06:41:09 +02:00
parent 9f47f34657
commit 6d6d0b09ff

16
cli.py
View file

@ -97,7 +97,21 @@ def delete(job_id, domain=DOMAIN):
def update(job_id, domain=DOMAIN): pass
def stop(job_id, domain=DOMAIN): pass
def stop(job_id, domain=DOMAIN):
response = request_api(
path=f"job/{job_id}/stop",
verb="post",
domain=domain,
check_return_code=False
)
if response.status_code == 404:
print(f"Error: no job with the id '{job_id}'")
sys.exit(1)
assert response.status_code == 200, response.content
def resume(job_id, domain=DOMAIN): pass