swh.scheduler.api.server module

swh.scheduler.api.server.get_global_scheduler()[source]
class swh.scheduler.api.server.SchedulerServerApp(*args, backend_class=None, backend_factory=None, **kwargs)[source]

Bases: swh.core.api.RPCServerApp

extra_type_decoders: Dict[str, Callable] = {'scheduler_model': <function <lambda>>}
extra_type_encoders: List[Tuple[type, str, Callable]] = [(<class 'swh.scheduler.model.BaseSchedulerModel'>, 'scheduler_model', <function _encode_model_object>)]
swh.scheduler.api.server.argument_error_handler(exception)[source]
swh.scheduler.api.server.my_error_handler(exception)[source]
swh.scheduler.api.server.has_no_empty_params(rule)[source]
swh.scheduler.api.server.index()[source]
swh.scheduler.api.server.site_map()[source]
swh.scheduler.api.server.load_and_check_config(config_file, type='local')[source]
Check the minimal configuration is set to run the api or raise an

error explanation.

Parameters
  • config_file (str) – Path to the configuration file to load

  • type (str) – configuration type. For ‘local’ type, more checks are done.

Raises

Error if the setup is not as expected

Returns

configuration as a dict

swh.scheduler.api.server.make_app_from_configfile()[source]

Run the WSGI app from the webserver, loading the configuration from a configuration file.

SWH_CONFIG_FILENAME environment variable defines the configuration path to load.