'Update schedule'

@api.validate(base_schedule_schema, description=u'Updated    Schedule    Object')
@api.response(201, model=api_schedule_schema)
def put(self, schedule_id, session=None):

    new_schedule = request.json
    schedules = self.manager.config.get(u'schedules', [])
    if (schedules is True):
        self.manager.config[u'schedules'] = DEFAULT_SCHEDULES
    elif (schedules is False):
        raise Conflict(u'Schedules    are    disables    in    config')
    (schedule, idx) = _schedule_by_id(schedule_id, self.manager.config[u'schedules'])
    if (not schedule):
        raise NotFoundError((u'schedule    %d    not    found' % schedule_id))
    new_schedule[u'id'] = id(schedule)
    self.manager.config[u'schedules'][idx] = new_schedule
    self.manager.save_config()
    self.manager.config_changed()
    resp = jsonify(new_schedule)
    resp.status_code = 201
    return resp
