Update a replication schedule.

    @param schedule_id: The id of the schedule to update.
    @param schedule: The modified schedule.
    @return: The updated replication schedule.
    @since: API v3
16469
def update_replication_schedule(self, schedule_id, schedule):
    
    return self._put("replications/%s" % schedule_id, ApiReplicationSchedule,
        data=schedule, api_version=3)
730121
def put_calendar_job(self, calendar_id, job_id, params=None):
        
        for param in (calendar_id, job_id):
            if param in SKIP_IN_PATH:
                raise ValueError("Empty value passed for a required argument.")
        return self.transport.perform_request(
            "PUT",
            _make_path("_ml", "calendars", calendar_id, "jobs", job_id),
            params=params,
        )
677419
public synchronized void insertSchedule(final Schedule s) {
    final Schedule exist = this.scheduleIdentityPairMap.get(s.getScheduleIdentityPair());
    if (s.updateTime()) {
      try {
        if (exist == null) {
          this.loader.insertSchedule(s);
          internalSchedule(s);
        } else {
          s.setScheduleId(exist.getScheduleId());
          this.loader.updateSchedule(s);
          internalSchedule(s);
        }
      } catch (final ScheduleManagerException e) {
        logger.error(e);
      }
    } else {
      logger
          .error("The provided schedule is non-recurring and the scheduled time already passed. "
              + s.getScheduleName());
    }
  }
474298
def schedule! options = {}
      options = options.dup

      if run_every = options.delete(:run_every)
        options[:run_interval] = serialize_duration(run_every)
      end

      @schedule_options = options.reverse_merge(@schedule_options || {}).reverse_merge(
        run_at: self.class.run_at,
        timezone: self.class.timezone,
        run_interval: serialize_duration(self.class.run_every),
        priority: self.class.priority,
        queue: self.class.queue
      )

      enqueue_opts = { priority: @schedule_options[:priority], run_at: next_run_time }
      enqueue_opts[:queue] = @schedule_options[:queue] if @schedule_options[:queue]

      Delayed::Job.transaction do
        self.class.jobs(@schedule_options).destroy_all
        if Gem.loaded_specs['delayed_job'].version.to_s.first.to_i < 3
          Delayed::Job.enqueue self, enqueue_opts[:priority], enqueue_opts[:run_at]
        else
          Delayed::Job.enqueue self, enqueue_opts
        end
      end
    end
722897
def scheduled_status(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
        return self.__api_request('GET', url)
1044233
def schedule(self, cron_schedule, base_datetime=None):
        

        logger.debug('Scheduling job {0} with cron schedule {1}'.format(self.name, cron_schedule))
        if not self.state.allow_change_schedule:
            raise DagobahError("job's schedule cannot be changed in state: %s"
                               % self.state.status)

        if cron_schedule is None:
            self.cron_schedule = None
            self.cron_iter = None
            self.next_run = None

        else:
            if base_datetime is None:
                base_datetime = datetime.utcnow()
            self.cron_schedule = cron_schedule
            self.cron_iter = croniter(cron_schedule, base_datetime)
            self.next_run = self.cron_iter.get_next(datetime)

        logger.debug('Determined job {0} next run of {1}'.format(self.name, self.next_run))
        self.commit()
474222
def reload(self, schedule):
        '''
        
        '''
        # Remove all jobs from self.intervals
        self.intervals = {}

        if 'schedule' in schedule:
            schedule = schedule['schedule']
        self.opts.setdefault('schedule', {}).update(schedule)
439413
def add_job(self, id, func, **kwargs):
        

        job_def = dict(kwargs)
        job_def['id'] = id
        job_def['func'] = func
        job_def['name'] = job_def.get('name') or id

        fix_job_def(job_def)

        return self._scheduler.add_job(**job_def)
228552
def scheduled_status_update(self, id, scheduled_at):
        
        scheduled_at = self.__consistent_isoformat_utc(scheduled_at)
        id = self.__unpack_id(id)
        params = self.__generate_params(locals(), ['id'])
        url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
        return self.__api_request('PUT', url, params)
753598
def generate_scheduling_block_id(num_blocks, project='test'):
    """"""
    _date = strftime("%Y%m%d", gmtime())
    _project = project
    for i in range(num_blocks):
        yield '{}-{}-sbi{:03d}'.format(_date, _project, i)
114516
def set_schedule(self, schedule):
        
        self.Tmax = schedule['tmax']
        self.Tmin = schedule['tmin']
        self.steps = int(schedule['steps'])
        self.updates = int(schedule['updates'])
685105
def scheduled_status_delete(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
        self.__api_request('DELETE', url)
1261194
def scheduled(self, offset=0, count=25):
        ''''''
        return self.client('jobs', 'scheduled', self.name, offset, count)
980893
def schedule_blast_from_blast(self, blast_id, schedule_time, options=None):
        
        options = options or {}
        data = options.copy()
        data['copy_blast'] = blast_id
        data['schedule_time'] = schedule_time
        return self.api_post('blast', data)
1034757
def seasonalAdjustment(self, sched_rule_id, adjustment):
        
        path = 'schedulerule/seasonal_adjustment'
        payload = {'id': sched_rule_id, 'adjustment': adjustment}
        return self.rachio.put(path, payload)
1207404
def update_scheduled_time(self, when):
        
        tiger = self.tiger

        ts = get_timestamp(when)
        assert ts

        pipeline = tiger.connection.pipeline()
        key = tiger._key(SCHEDULED, self.queue)
        tiger.scripts.zadd(key, ts, self.id, mode='xx', client=pipeline)
        pipeline.zscore(key, self.id)
        _, score = pipeline.execute()
        if not score:
            raise TaskNotFound('Task {} not found in queue "{}" in state "{}".'.format(
                self.id, self.queue, SCHEDULED
            ))

        self._ts = ts
732718
def modify_job(self, name, schedule, persist=True):
        '''
        
        '''
        # ensure job exists, then replace it
        if name in self.opts['schedule']:
            self.delete_job(name, persist)
        elif name in self._get_schedule(include_opts=False):
            log.warning("Cannot modify job %s, it's in the pillar!", name)
            return

        self.opts['schedule'][name] = schedule

        if persist:
            self.persist()