From acdbdd377c0bb13cf393184a073cc74fe85bc4eb Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Thu, 28 Jan 2016 13:40:00 +0800 Subject: [PATCH] doc: Fix wrong description about adding RESTful API * Replace wrong example * Remove outdated description about serialization Change-Id: I1da230ce3b1979a0a337fc50d105de5f78f995bc --- doc/source/devref/addmethod.openstackapi.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/source/devref/addmethod.openstackapi.rst b/doc/source/devref/addmethod.openstackapi.rst index 50bdeb06112..001fc74483b 100644 --- a/doc/source/devref/addmethod.openstackapi.rst +++ b/doc/source/devref/addmethod.openstackapi.rst @@ -35,7 +35,7 @@ Controllers and actions 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. @@ -44,10 +44,6 @@ Serialization 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. ```` list contains ```` tags) and which dictionary keys are to be XML attributes as opposed to subtags (e.g. ```` instead of ``4``). - -See `cinder/api/openstack/servers.py` for an example. - Faults ------