WSGI middleware for OpenStack API controllers.
APIMapper
(controller_scan=<function controller_scan>, directory=None, always_scan=False, register=True, explicit=True)¶Bases: routes.mapper.Mapper
connect
(*args, **kwargs)¶Create and connect a new Route to the Mapper.
Usage:
m = Mapper()
m.connect(':controller/:action/:id')
m.connect('date/:year/:month/:day', controller="blog",
action="view")
m.connect('archives/:page', controller="blog", action="by_page",
requirements = { 'page':'\d{1,2}' })
m.connect('category_list', 'archives/category/:section',
controller='blog', action='category',
section='home', type='list')
m.connect('home', '', controller='blog', action='view',
section='home')
routematch
(url=None, environ=None)¶Match a URL against against one of the routes contained.
Will return None if no valid match is found, otherwise a result dict and a route object is returned.
resultdict, route_obj = m.match('/joe/sixpack')
APIRouter
(ext_mgr=None)¶Bases: oslo_service.wsgi.Router
Routes requests on the API to the appropriate controller and method.
ExtensionManager
= None¶factory
(global_config, **local_config)¶Simple paste factory, cinder.wsgi.Router
doesn’t have.
ProjectMapper
(controller_scan=<function controller_scan>, directory=None, always_scan=False, register=True, explicit=True)¶Bases: cinder.api.openstack.APIMapper
resource
(member_name, collection_name, **kwargs)¶Base resource path handler
This method is compatible with resource paths that include a project_id and those that don’t. Including project_id in the URLs was a legacy API requirement; and making API requests against such endpoints won’t work for users that don’t belong to a particular project.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.