The congress.api.application Module

class congress.api.application.ApiApplication(resource_mgr)

Bases: object

An API web application that binds REST resources to a wsgi server.

This indirection between the wsgi server and REST resources facilitates binding the same resource tree to multiple endpoints (e.g. HTTP/HTTPS).

class congress.api.application.ResourceManager

Bases: congress.dse2.data_service.DataService

A container for REST API resources.

This container is meant to be called from one or more wsgi servers/ports.

handlers: An array of API resource handlers for registered resources.

Find a handler for a REST request.

request: A webob request object.
A handler instance or None.
register_handler(handler, search_index=None)

Register a new resource handler.


handler: The resource handler to register. search_index: Priority of resource handler to resolve cases where

a request matches multiple handlers.