swh.scheduler.api.server module#
- class swh.scheduler.api.server.SchedulerServerApp(*args, backend_class=None, backend_factory=None, **kwargs)[source]#
Bases:
RPCServerApp
- extra_type_decoders: Dict[str, Callable] = {'last_visit_status': <enum 'LastVisitStatus'>, 'scheduler_model': <function <lambda>>}#
Value of extra_decoders passed to json_loads or msgpack_loads to be able to deserialize more object types.
- extra_type_encoders: List[Tuple[type, str, Callable]] = [(<class 'swh.scheduler.model.BaseSchedulerModel'>, 'scheduler_model', <function _encode_model_object>), (<enum 'LastVisitStatus'>, 'last_visit_status', <function _encode_enum>)]#
Value of extra_encoders passed to json_dumps or msgpack_dumps to be able to serialize more object types.
- swh.scheduler.api.server.load_and_check_config(config_path: str, type: str = 'postgresql') Dict [source]#
- Check the minimal configuration is set to run the api or raise an
error explanation.
- Parameters:
config_path – Configuration file path to load
type – Configuration type, for ‘postgresql’ type (the default), more checks are done.
- Raises:
Error if the setup is not as expected –
- Returns:
configuration as a dict