Commit 1c276df5 authored by Andrea Manzi's avatar Andrea Manzi
Browse files

Merge branch 'allow-bulk-status' into 'develop'

Allow bulk status requests from python client

See merge request !17
parents a000125e 02d0b191
Pipeline #610686 passed with stage
in 1 minute and 29 seconds
......@@ -30,11 +30,35 @@ class Inquirer(object):
self.context = context
def get_job_status(self, job_id, list_files=False):
if not isinstance(job_id, str):
raise Exception('The job_id provided is not a string!')
job_info = json.loads(self.context.get("/jobs/%s" % job_id))
if list_files:
job_info['files'] = json.loads(self.context.get("/jobs/%s/files" % job_id))
job_info['dm'] = json.loads(self.context.get("/jobs/%s/dm" % job_id))
return job_info
except NotFound:
raise NotFound(job_id)
def get_jobs_statuses(self, job_ids, list_files=False):
if isinstance(job_ids, list):
xfer_ids = ','.join(job_ids)
raise Exception('The input provided is not a list of ids!')
if not list_files:
job_info = json.loads(self.context.get("/jobs/%s" % xfer_ids))
job_info = json.loads(self.context.get("/jobs/%s?files=file_state,dest_surl,finish_time,start_time,reason,source_surl,file_metadata" % xfer_ids))
return job_info
except NotFound:
raise NotFound(job_id)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment