swh.objstorage.api.server module#

swh.objstorage.api.server.timed(f)[source]#
swh.objstorage.api.server.timed_context(f_name)[source]#
swh.objstorage.api.server.get_objstorage()[source]#
class swh.objstorage.api.server.ObjStorageServerApp(*args, backend_class=None, backend_factory=None, **kwargs)[source]#

Bases: RPCServerApp

client_exception_classes = (<class 'swh.objstorage.exc.ObjNotFoundError'>, <class 'swh.objstorage.exc.ObjCorruptedError'>, <class 'swh.objstorage.exc.Error'>)#
method_decorators: List[Callable[[Callable], Callable]] = [<function timed>]#

List of decorators to all methods generated from the backend_class.

pre_add(kw)[source]#

Called before the ‘add’ method.

post_get(ret, kw)[source]#

Called after the ‘get’ method.

swh.objstorage.api.server.argument_error_handler(exception)[source]#
swh.objstorage.api.server.my_error_handler(exception)[source]#
swh.objstorage.api.server.index()[source]#
swh.objstorage.api.server.list_content()[source]#
swh.objstorage.api.server.load_and_check_config(config_file)[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

Raises:

Error if the setup is not as expected

Returns:

configuration as a dict

swh.objstorage.api.server.validate_config(cfg)[source]#
Check the minimal configuration is set to run the api or raise an

explanatory error.

Parameters:

cfg (dict) – Loaded configuration.

Raises:

Error if the setup is not as expected

Returns:

configuration as a dict

swh.objstorage.api.server.make_app_from_configfile()[source]#

Load configuration and then build application to run