def test_cancel_job_execution(self): response = self.get_file_content("cancel_je_response.json") self.mock_response_json_values(response) execution = self.proxy.cancel_job_execution( _je.JobExecution(id="execution-id")) self.assert_session_get_with("job-executions/execution-id/cancel") self.verify_execution(response["job_execution"], execution)
def execute_job(self, job, **job_execution): """Execute a Job :param job: value can be the ID of a Job or an instance of :class:`~openstack.map_reduce.v1.job.Job` :returns: Job Execution Instance :rtype: :class:`~openstack.map_reduce.v1.job_execution.JobExecution` """ job = self._get_resource(_job.Job, job) execution = _execution.JobExecution(job_id=job.id, **job_execution) return execution.create(self._session)
def test_delete_job_execution_binary_with_instance(self): self.proxy.delete_job_execution(_je.JobExecution(id="execution-id")) self.assert_session_delete("job-executions/execution-id")