コード例 #1
0
ファイル: job.py プロジェクト: talaniz/peloton
 def list_tasks(self):
     """
     :return: The map of instance ID to task info for all matching tasks
     """
     request = task.ListRequest(jobId=peloton.JobID(value=self.job_id))
     resp = self.client.task_svc.List(
         request,
         metadata=self.client.jobmgr_metadata,
         timeout=self.config.rpc_timeout_sec,
     )
     assert not resp.HasField("notFound")
     return resp.result
コード例 #2
0
    def get_tasks(self, job_id):
        """
        param job_id: id of the job
        type job_id: str

        rtype: job.ListResponse
        """
        request = task.ListRequest(jobId=peloton.JobID(value=job_id))
        try:
            resp = self.client.task_svc.List(
                request,
                metadata=self.client.jobmgr_metadata,
                timeout=default_timeout,
            ).result.value
            return resp
        except Exception as e:
            print_fail("Exception calling List Tasks :%s" % str(e))
            raise