From: Zack Cerza Date: Thu, 6 Oct 2016 17:44:09 +0000 (-0600) Subject: Add ResultsReporter.get_run() X-Git-Tag: 1.1.0~521^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ba13ca41333b527cc534e7f98c148e8f16c40be5;p=teuthology.git Add ResultsReporter.get_run() Signed-off-by: Zack Cerza --- diff --git a/teuthology/report.py b/teuthology/report.py index 11cf0ea219..11d22ed441 100644 --- a/teuthology/report.py +++ b/teuthology/report.py @@ -366,6 +366,21 @@ class ResultsReporter(object): response.raise_for_status() return response.json() + def get_run(self, run_name, fields=None): + """ + Query the results server for a run + + :param run_name: The name of the run + :param fields: Optional. A list of fields to include in the result. + Defaults to returning all fields. + """ + uri = "{base}/runs/{name}".format(base=self.base_uri, name=run_name) + if fields: + uri += "?fields=" + ','.join(fields) + response = self.session.get(uri) + response.raise_for_status() + return response.json() + def delete_job(self, run_name, job_id): """ Delete a job from the results server.