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.

Attributes:

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

get_handler(request)

Find a handler for a REST request.

Param

request: A webob request object.

Returns

A handler instance or None.

register_handler(handler, search_index=None)

Register a new resource handler.

Param

handler: The resource handler to register.

Param

search_index: Priority of resource handler to resolve cases where a request matches multiple handlers.