Deletes a job from the scheduler. Ignores jobs from pillar
164628
def delete_job_prefix(self, name, persist=True):
        '''
        
        '''
        # ensure job exists, then delete it
        for job in list(self.opts['schedule'].keys()):
            if job.startswith(name):
                del self.opts['schedule'][job]
        for job in self._get_schedule(include_opts=False):
            if job.startswith(name):
                log.warning("Cannot delete job %s, it's in the pillar!", job)

        # Fire the complete event back along with updated list of schedule
        evt = salt.utils.event.get_event('minion', opts=self.opts, listen=False)
        evt.fire_event({'complete': True,
                        'schedule': self._get_schedule()},
                       tag='/salt/minion/minion_schedule_delete_complete')

        # remove from self.intervals
        for job in list(self.intervals.keys()):
            if job.startswith(name):
                del self.intervals[job]

        if persist:
            self.persist()
673285
def rm_job(name):
    '''
    
    '''
    response = salt.utils.http.query(
        "{0}/scheduler/job/{1}".format(_base_url(), name),
        method='DELETE',
    )
    return True
400047
def delete_job(name=None):
    '''
    

    '''
    if not name:
        raise SaltInvocationError('Required parameter \'name\' is missing')

    server = _connect()

    if not job_exists(name):
        raise CommandExecutionError('Job \'{0}\' does not exist'.format(name))

    try:
        server.delete_job(name)
    except jenkins.JenkinsException as err:
        raise CommandExecutionError(
            'Encountered error deleting job \'{0}\': {1}'.format(name, err)
        )
    return True
1171371
def syscall_clearremovequeue(queue, index):
    '''
    
    '''
    def _syscall(scheduler, processor):
        qes, qees = queue[index].clear()
        events = scheduler.queue.unblockqueue(queue[index])
        for e in events:
            scheduler.eventtree.remove(e)
        qes2, qees2 = queue.removeSubQueue(index)
        for e in qes:
            processor(e)
        for e in qes2:
            processor(e)
        for e in qees:
            processor(e)
        for e in qees2:
            processor(e)
    return _syscall
223642
def delete_job(self, job_name):
        
        logger.debug('Deleting job {0}'.format(job_name))
        for idx, job in enumerate(self.jobs):
            if job.name == job_name:
                self.backend.delete_job(job.job_id)
                del self.jobs[idx]
                self.commit()
                return
        raise DagobahError('no job with name %s exists' % job_name)
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)
1157594
def cancel_job(self, job_id=None, job_name=None):
        
        return self._delegator.cancel_job(job_id=job_id, job_name = job_name)
508127
def handle_job_and_work_delete(self, sender, instance, **kwargs):
    
    self.handle_delete(instance.project.__class__, instance.project)
848954
def cancel_job(self, job_id=None, job_name=None):
        
        payload = {}
        if job_name is not None:
            payload['job_name'] = job_name
        if job_id is not None:
            payload['job_id'] = job_id

        jobs_url = self._get_url('jobs_path')
        res = self.rest_client.session.delete(jobs_url, params=payload)
        _handle_http_errors(res)
        return res.json()
380647
def delete_job(self, id, jobstore=None):
        
        warnings.warn('delete_job has been deprecated, use remove_job instead.', DeprecationWarning)

        self.remove_job(id, jobstore)
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')
705417
def delete(self):
        
        logger.debug('Deleting Dagobah instance with ID {0}'.format(self.dagobah_id))
        self.jobs = []
        self.created_jobs = 0
        self.backend.delete_dagobah(self.dagobah_id)
975288
def clear_jobs(self, recursive=True):
        
        if recursive:
            self._scatter_link.clear_jobs(recursive)
        self.jobs.clear()
903975
def delete_job(job_id,
               deployment_name,
               token_manager=None,
               app_url=defaults.APP_URL):
    
    headers = token_manager.get_access_token_headers()
    data_url = get_data_url_for_job(job_id,
                                    deployment_name,
                                    token_manager=token_manager,
                                    app_url=app_url)

    url = '%s/api/v1/jobs/%s' % (data_url, job_id)
    response = requests.delete(url, headers=headers)

    if response.status_code != 200:
        raise JutException('Error %s: %s' % (response.status_code, response.text))
555180
async def destroy(self, container = None):
        
        if container is None:
            container = RoutineContainer(self.scheduler)
        if self.queue is not None:
            await container.syscall_noreturn(syscall_removequeue(self.scheduler.queue, self.queue))
            self.queue = None
611291
def skip_if_needed(self, job_record):
        
        tree = self.get_tree(job_record.process_name)
        node = tree.get_node(job_record.process_name, job_record.timeperiod)
        if tree.should_skip_tree_node(node):
            self.skip_tree_node(node)
739103
def remove_go(self, target):
        
        with self.lock:
            if not self._go:
                try:
                    self.job_queue.remove(target)
                except ValueError:
                    pass