Fix rst formatting and cross-references
blueprint sphinx-doc-cleanup bug 944385 - Fix formatting and markup issues that produce error messages - Update TOC lists for missing/new files - Fix a few links - Update instructions with dependencies for building the documentation - Updated base on review comments from oubiwann to fix trailing whitespace in modified files Change-Id: I589152bfab9c543d2b11fa8bed2344259aa90675
This commit is contained in:
committed by
Lorin Hochstein
parent
8979743653
commit
c16cd04cf6
@@ -1,5 +1,5 @@
|
||||
..
|
||||
Copyright 2010-2011 OpenStack LLC
|
||||
Copyright 2010-2011 OpenStack LLC
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
@@ -22,9 +22,9 @@ The interface is a mostly RESTful API. REST stands for Representational State Tr
|
||||
Routing
|
||||
-------
|
||||
|
||||
To map URLs to controllers+actions, OpenStack uses the Routes package, a clone of Rails routes for Python implementations. See http://routes.groovie.org/ fore more information.
|
||||
To map URLs to controllers+actions, OpenStack uses the Routes package, a clone of Rails routes for Python implementations. See http://routes.groovie.org/ for more information.
|
||||
|
||||
URLs are mapped to "action" methods on "controller" classes in `nova/api/openstack/__init__/ApiRouter.__init__` .
|
||||
URLs are mapped to "action" methods on "controller" classes in ``nova/api/openstack/__init__/ApiRouter.__init__`` .
|
||||
|
||||
See http://routes.groovie.org/manual.html for all syntax, but you'll probably just need these two:
|
||||
- mapper.connect() lets you map a single URL to a single action on a controller.
|
||||
@@ -33,9 +33,9 @@ See http://routes.groovie.org/manual.html for all syntax, but you'll probably ju
|
||||
Controllers and actions
|
||||
-----------------------
|
||||
|
||||
Controllers live in `nova/api/openstack`, and inherit from nova.wsgi.Controller.
|
||||
Controllers live in ``nova/api/openstack``, and inherit from nova.wsgi.Controller.
|
||||
|
||||
See `nova/api/openstack/servers.py` for an example.
|
||||
See ``nova/api/openstack/servers.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,7 +44,7 @@ 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. <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>).
|
||||
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 `nova/api/openstack/servers.py` for an example.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user