]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add ResultsReporter.get_run()
authorZack Cerza <zack@redhat.com>
Thu, 6 Oct 2016 17:44:09 +0000 (11:44 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 6 Oct 2016 17:44:09 +0000 (11:44 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/report.py

index 11cf0ea219ddf48ed1b5e5d1627a625f1af6dfa2..11d22ed441883390c081103fe70a326243151f52 100644 (file)
@@ -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.