'Add new schedule'

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

    data = request.json
    schedules = self.manager.config.get(u'schedules', [])
    if (schedules is True):
        schedules = DEFAULT_SCHEDULES
    elif (schedules is False):
        raise Conflict(u'Schedules    are    disables    in    config')
    self.manager.config[u'schedules'] = schedules
    self.manager.config[u'schedules'].append(data)
    schedules = self.manager.config[u'schedules']
    (new_schedule, _) = _schedule_by_id(id(data), schedules)
    if (not new_schedule):
        raise APIError(u'schedule    went    missing    after    add')
    self.manager.save_config()
    self.manager.config_changed()
    resp = jsonify(new_schedule)
    resp.status_code = 201
    return resp
