bexchange.web package¶
Submodules¶
bexchange.web.app module¶
- class bexchange.web.app.Application(backend)[source]¶
Bases:
object
- classmethod from_conf(conf)[source]¶
create instance from configuration. :param conf: a
Properties
instance to configurefrom
bexchange.web.auth module¶
- class bexchange.web.auth.AuthMiddleware(app, authmgr)[source]¶
Bases:
object
WSGI middleware providing authentication. Actual authentication is delegated to an
Auth
implementation registered as a provider here.The provider and credentials are extracted using
get_credentials()
.- Parameters:
app – the WSGI application receiving the request if authentication is successful.
bexchange.web.handler module¶
- bexchange.web.handler.file_arrival(ctx)[source]¶
Returns if a file with specified source, object type has arrived within limit
- Parameters:
ctx (
RequestContext
) – the request context- Returns:
JsonResponse
with status 200 Created and information in body
See doc-rest-cmd-file-arrival for details
- bexchange.web.handler.get_server_nodename(ctx)[source]¶
:returns the server nodename
See doc-rest-cmd-server_info for details
- bexchange.web.handler.get_server_publickey(ctx)[source]¶
:returns the server publickey
See doc-rest-cmd-server_info for details
- bexchange.web.handler.get_server_uptime(ctx)[source]¶
:returns the server uptime
See doc-rest-cmd-server_info for details
- bexchange.web.handler.get_statistics(ctx)[source]¶
Returns the statistics for modules / sources
- Parameters:
ctx (
RequestContext
) – the request context- Returns:
JsonResponse
with status 200 Created and information in body
See doc-rest-cmd-get_statistics for details
- bexchange.web.handler.list_statistic_ids(ctx)[source]¶
Returns the statistic ids
- Parameters:
ctx (
RequestContext
) – the request context- Returns:
JsonResponse
with status 200 Created and information in body
See list_statistic_ids for details
- bexchange.web.handler.post_file(ctx)[source]¶
Receive a file from some party
- Parameters:
ctx (
RequestContext
) – the request context- Returns:
JsonResponse
with status 200 OK
See store for details
- bexchange.web.handler.post_json_message(ctx)[source]¶
A trigger message used to trigger different jobs from the outside
- Parameters:
ctx (
RequestContext
) – the request context- Returns:
JsonResponse
with status 201 Created and metadata in body- Raise:
HttpConflict
when file already stored
See post_message for details
- bexchange.web.handler.supervise(ctx)[source]¶
Provides functionality for supervising the node
- Parameters:
ctx (
RequestContext
) – the request context- Returns:
JsonResponse
with status 200 Created and information in body
See doc-rest-cmd-file-arrival for details
bexchange.web.routing module¶
bexchange.web.util module¶
- exception bexchange.web.util.HttpBadRequest(description=None, response=None)[source]¶
Bases:
HTTPException
- code = 400¶
- exception bexchange.web.util.HttpConflict(description=None, response=None)[source]¶
Bases:
HTTPException
- code = 409¶
- exception bexchange.web.util.HttpForbidden(description=None, response=None)[source]¶
Bases:
HTTPException
- code = 403¶
- exception bexchange.web.util.HttpNotAcceptable(description=None, response=None)[source]¶
Bases:
HTTPException
- code = 406¶
- exception bexchange.web.util.HttpNotFound(description=None, response=None)[source]¶
Bases:
HTTPException
- code = 404¶
- exception bexchange.web.util.HttpUnauthorized(challenge)[source]¶
Bases:
HTTPException
401 Unauthorized
- Parameters:
challenge – a string to reply in www-authenticate header. If given as a sequence of strings, multiple www-authenticate headers will be set in the response.
- code = 401¶
- class bexchange.web.util.JsonRequestMixin[source]¶
Bases:
object
Request mixin providing JSON-decoding of request body
- get_json_data()[source]¶
try JSON decoding
self.data
- Returns:
the decoded data
- Raise:
HttpBadRequest
if decoding fails
- class bexchange.web.util.Request(environ, max_content_length=None, max_form_memory_size=None)[source]¶
Bases:
Request
,JsonRequestMixin