def cancel_job(self, job_id=None, job_name=None):
payload = {}<EOL>if job_name is not None:<EOL><INDENT>payload['<STR_LIT>'] = job_name<EOL><DEDENT>if job_id is not None:<EOL><INDENT>payload['<STR_LIT>'] = job_id<EOL><DEDENT>jobs_url = self._get_url('<STR_LIT>')<EOL>res = self.rest_client.session.delete(jobs_url, params=payload)<EOL>_handle_http_errors(res)<EOL>return res.json()<EOL>
Cancel a running job.

        Args:
            job_id (str, optional): Identifier of job to be canceled.
            job_name (str, optional): Name of job to be canceled.

        Returns:
            dict: JSON response for the job cancel operation.