Пример #1
0
    def job_info(self, job_id):
        coord_id, _ = model.parse_coordinator_id(job_id)
        if coord_id:
            return self.job_coordinator_info(coordinator_id=job_id)

        wf_id, _ = model.parse_workflow_id(job_id)
        if wf_id:
            return self.job_workflow_info(workflow_id=job_id)

        raise exceptions.OozieException.job_not_found(job_id)
Пример #2
0
 def _workflow_query(self, job_id):
     wf_id, _ = model.parse_workflow_id(job_id)
     if not wf_id:
         raise ValueError("Unrecognized job ID: '{}'".format(job_id))
     try:
         result = self._get('job/' + wf_id)
         workflow = self.JOB_TYPES[model.ArtifactType.Workflow](self, result)
         return workflow
     except exceptions.OozieException as err:
         raise exceptions.OozieException.workflow_not_found(job_id, err)
Пример #3
0
    def job_action_info(self, job_id):
        coord_id, action = model.parse_coordinator_id(job_id)
        if coord_id:
            coord = self.job_coordinator_info(coordinator_id=job_id)
            return coord.action(action) if coord and action else coord

        wf_id, action = model.parse_workflow_id(job_id)
        if wf_id:
            workflow = self.job_workflow_info(workflow_id=job_id)
            return workflow.action(action) if workflow and action else workflow

        raise exceptions.OozieException.job_not_found(job_id)