Controllers live in ``cinder/api/openstack``, and inherit from cinder.wsgi.Controller.
-See ``cinder/api/openstack/servers.py`` for an example.
+See ``cinder/api/v2/volumes.py`` for an example.
Action methods take parameters that are sucked out of the URL by mapper.connect() or .resource(). The first two parameters are self and the WebOb request, from which you can get the req.environ, req.body, req.headers, etc.
Actions return a dictionary, and wsgi.Controller serializes that to JSON or XML based on the request's content-type.
-If you define a new controller, you'll need to define a ``_serialization_metadata`` attribute on the class, to tell wsgi.Controller how to convert your dictionary to XML. It needs to know the singular form of any list tag (e.g. ``<servers>`` list contains ``<server>`` tags) and which dictionary keys are to be XML attributes as opposed to subtags (e.g. ``<server id="4"/>`` instead of ``<server><id>4</id></server>``).
-
-See `cinder/api/openstack/servers.py` for an example.
-
Faults
------