Bases: object
Maps method name to local methods through action name.
Find and call local method.
Bases: object
Default controller.
Bases: type
Controller metaclass.
This metaclass automates the task of assembling a dictionary mapping action keys to method names.
Bases: nova.api.openstack.wsgi.ActionDispatcher
Default request body serialization.
Bases: webob.exc.HTTPException
Wrap webob.exc.HTTPException to provide API friendly response.
Bases: nova.api.openstack.wsgi.TextDeserializer
Bases: nova.api.openstack.wsgi.DictSerializer
Default JSON request body serialization.
Bases: nova.api.openstack.wsgi.XMLDeserializer
Marshal the metadata attribute of a parsed request.
Bases: webob.exc.HTTPException
Rate-limited request response.
Bases: webob.request.Request
Add some OpenStack API-specific logic to the base webob.Request.
Determine the requested response content-type.
Allow API methods to store objects from a DB query to be used by API extensions within the same API request.
An instance of this class only lives for the lifetime of a single API request, so there’s no need to implement full cache management.
Determine content type of the request body.
Does not do any body introspection, only checks header
Allow an API extension to get a previously stored object within the same API request.
Note that the object data will be slightly stale.
Allow an API extension to get previously stored objects within the same API request.
Note that the object data will be slightly stale.
Bases: nova.wsgi.Application
WSGI app that handles (de)serialization and controller dispatch.
WSGI app that reads routing information supplied by RoutesMiddleware and calls the requested action method upon its controller. All controller action methods must accept a ‘req’ argument, which is the incoming wsgi.Request. If the operation is a PUT or POST, the controller method must also accept a ‘body’ argument (the deserialized request body). They may raise a webob.exc exception or return a dict, which will be serialized by requested content type.
Exceptions derived from webob.exc.HTTPException will be automatically wrapped in Fault() to provide API friendly error responses.
Dispatch a call to the action-specific method.
Parse dictionary created by routes library.
Registers controller actions with this resource.
Registers controller extensions with this resource.
Bases: object
Context manager to handle Resource exceptions.
Used when processing exceptions generated by API implementation methods (or their extensions). Converts most exceptions to Fault exceptions, with the appropriate logging.
Bases: object
Bundles a response object with appropriate serializers.
Object that app methods may return in order to bind alternate serializers with a response object to be serialized. Its use is optional.
Attach slave templates to serializers.
Retrieve the response status.
Returns the serializer for the wrapped object.
Returns the serializer for the wrapped object subject to the indicated content type. If no serializer matching the content type is attached, an appropriate serializer drawn from the default serializers will be used. If no appropriate serializer is available, raises InvalidContentType.
Retrieve the headers.
Prepares the serializer that will be used to serialize.
Determines the serializer that will be used and prepares an instance of it for later call. This allows the serializer to be accessed by extensions for, e.g., template extension.
Serializes the wrapped object.
Utility method for serializing the wrapped object. Returns a webob.Response object.
Bases: nova.api.openstack.wsgi.ActionDispatcher
Default request body deserialization.
Bases: nova.api.openstack.wsgi.TextDeserializer
Get only Element type childs from node.
Get the text field contained by the given node.
Get an attribute value; fallback to an element if not found.
Return all of a nodes children who have the given name.
Search a nodes children for the first child with a given name.
Search a nodes children for the first child with a given name.
Bases: nova.api.openstack.wsgi.DictSerializer
Mark a function as an action.
The given name will be taken as the action key in the body.
This is also overloaded to allow extensions to provide non-extending definitions of create and delete operations.
Determine action to invoke.
Determine action to invoke.
Attaches deserializers to a method.
This decorator associates a dictionary of deserializers with a method. Note that the function attributes are directly manipulated; the method is not wrapped.
Indicate a function extends an operation.
Can be used as either:
@extends
def index(...):
pass
or as:
@extends(action='resize')
def _action_resize(...):
pass
Attaches response code to a method.
This decorator associates a response code with a method. Note that the function attributes are directly manipulated; the method is not wrapped.
Attaches serializers to a method.
This decorator associates a dictionary of serializers with a method. Note that the function attributes are directly manipulated; the method is not wrapped.