Cancels a job.

@param jobId the id of the job to cancel
@return the response
341716
@POST
  @Path(ServiceConstants.CANCEL)
  public Response cancel(@QueryParam("jobId") final long jobId) {
    return RestUtils.call(new RestUtils.RestCallable<Void>() {
      @Override
      public Void call() throws Exception {
        mJobMaster.cancel(jobId);
        return null;
      }
    }, ServerConfiguration.global());
  }
594206
def cancel(id)
      Log.warn "Cancelling job id #{id}"
      job = @jobs_by_id[id]
      job.status = Executor::STATUS_ERROR
      job.owner = nil
      job.time_end = Time.now
      @queue.delete(job)
    end
634680
def cancel(self, job):
        
        if isinstance(job, self.job_class):
            self.connection.zrem(self.scheduled_jobs_key, job.id)
        else:
            self.connection.zrem(self.scheduled_jobs_key, job)
227889
def cancelPendingResult( self, jobid ):
        """"""
        if jobid in self._pending.keys():
            k = self._pending[jobid]
            del self._pending[jobid]
            if k in self._results.keys():
                rs = self._results[k]
                j = rs.index(jobid)
                del rs[j]
            else:
                # we've screwed-up the internal data structures
                raise RuntimeError('Internal structure error for {j} -> {ps}'.format(j = jobid,
                                                                                     ps = k))
        else:
            # no such job
            # sd: should this just fail silently?
            raise KeyError('No pending result with id {j}'.format(j = jobid))
168338
private function stopExecution(string $jobId, string $executionArn): void
    {
        try {
            $this->sfnClient->stopExecution([
                'executionArn' => $executionArn,
                'cause'        => 'canceled',
            ]);
        } catch (\Throwable $t) {
            $this->logger->error(
                'Failed to stopExecution of [{execution_arn}] for [{job_id}].',
                [
                    'exception'     => $t,
                    'execution_arn' => $executionArn,
                    'job_id'        => $jobId,
                ]
            );
        }
    }
1157594
def cancel_job(self, job_id=None, job_name=None):
        
        return self._delegator.cancel_job(job_id=job_id, job_name = job_name)
1059100
def cancel_job(self, job_resource_name: str):
        
        self.service.projects().programs().jobs().cancel(
            name=job_resource_name, body={}).execute()
508538
public synchronized void cancel() {
    for (int taskId : mJobInfo.getTaskIdList()) {
      mCommandManager.submitCancelTaskCommand(mJobInfo.getId(), taskId,
          mTaskIdToWorkerInfo.get(taskId).getId());
    }
  }
174851
public void cancel(final String msg) {
    JobState js = msg == null ? JobState.CANCELLED : JobState.FAILED;
    cancel(msg, js);
  }
125375
public void cancelFaxJob(FaxJob faxJob)
    {
        //validate fax job ID
        this.invokeFaxJobIDValidation(faxJob);
        
        //invoke action
        this.cancelFaxJobImpl(faxJob);
        
        //fire event
        this.fireFaxEvent(FaxClientActionEventID.CANCEL_FAX_JOB,faxJob);
    }
986748
public function destroy(JobRequest $request, Job $job)
    {
        try {

            $job->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('career::job.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('career/job/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('career/job/' . $job->getRouteKey()))
                ->redirect();
        }

    }
358875
def delete_job(self, job_id):
        """"""
        if hasattr(job_id, 'job_id'):
            job_id = job_id.job_id
        with self._sock_ctx() as socket:
            self._send_message('delete {0}'.format(job_id), socket)
            self._receive_word(socket, b'DELETED')
87252
public JsonResponse getJobStatus(String jobId) throws IOException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(Job.JOB_ID, jobId);
        return apiGet(ApiAction.job, params);
    }
461989
def cancel(self, job_ids):
        ''' 
        '''

        job_id_list = ' '.join(job_ids)
        retcode, stdout, stderr = self.channel.execute_wait("qdel {0}".format(job_id_list), 3)
        rets = None
        if retcode == 0:
            for jid in job_ids:
                self.resources[jid]['status'] = translate_table['E']  # Setting state to exiting
            rets = [True for i in job_ids]
        else:
            rets = [False for i in job_ids]

        return rets
78561
private void removeScheduledJob(UUID jobId, boolean complete) {
    ScheduledJob sched = jobs.remove(jobId);
    if (sched != null) {
      if (complete) {
        sched.monitor.notifyComplete();
        if (logger.isInfoEnabled()) {
          logger.info("Job complete (" + jobId.toString() + ")");
        }
      } else {
        sched.monitor.notifyCancelled();
        if (logger.isInfoEnabled()) {
          logger.info("Job cancelled (" + jobId.toString() + ")");
        }
      }
      jobs.remove(jobId);
      scheduler.removeJob(jobId);
    }
    if (jobs.isEmpty()) {
      synchronized (this.complete) {
        this.complete.notifyAll();
      }
    }
  }
138749
def request_job_cancel(self, job_id):
        
        msg = CancelMessage(job_id)
        self.messaging_backend.send(self.worker_mailbox, msg)
        self.storage_backend.mark_job_as_canceling(job_id)
280300
@Override
	public void disconnectJobManager(JobID jobId, Exception cause) {
		closeJobManagerConnection(jobId, cause);
		jobLeaderService.reconnect(jobId);
	}