summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc
diff options
context:
space:
mode:
authorJoe Heck <heckj@mac.com>2012-11-11 21:00:42 +0000
committerJoe Heck <heckj@mac.com>2012-11-18 18:19:50 -0800
commitb6d24bbad9493b4318367c23cbab8c4f688a924a (patch)
tree12b9a67982eef705d29433a7dbb0b1e8a931bbd0 /openstack/common/rpc
parent8aca5eb5868b5ead362777abb093f11c6d8b1817 (diff)
downloadoslo-b6d24bbad9493b4318367c23cbab8c4f688a924a.tar.gz
oslo-b6d24bbad9493b4318367c23cbab8c4f688a924a.tar.xz
oslo-b6d24bbad9493b4318367c23cbab8c4f688a924a.zip
updating sphinx documentation
* adding openstack theming (copied from keystone project theme) * updating .gitignore to ignore generated API docs * updated formatting in index.rst page * updaed openstack/common/processutils.py to match hacking docstring * updated docstrings to resolve sphinx warnings Change-Id: Ie89afe20eeab1efd2daf440fc65ccdf90f723c51
Diffstat (limited to 'openstack/common/rpc')
-rw-r--r--openstack/common/rpc/dispatcher.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/openstack/common/rpc/dispatcher.py b/openstack/common/rpc/dispatcher.py
index 965aedc..f09879c 100644
--- a/openstack/common/rpc/dispatcher.py
+++ b/openstack/common/rpc/dispatcher.py
@@ -41,8 +41,8 @@ server side of the API at the same time. However, as the code stands today,
there can be both versioned and unversioned APIs implemented in the same code
base.
-
-EXAMPLES:
+EXAMPLES
+========
Nova was the first project to use versioned rpc APIs. Consider the compute rpc
API as an example. The client side is in nova/compute/rpcapi.py and the server
@@ -50,12 +50,13 @@ side is in nova/compute/manager.py.
Example 1) Adding a new method.
+-------------------------------
Adding a new method is a backwards compatible change. It should be added to
nova/compute/manager.py, and RPC_API_VERSION should be bumped from X.Y to
X.Y+1. On the client side, the new method in nova/compute/rpcapi.py should
have a specific version specified to indicate the minimum API version that must
-be implemented for the method to be supported. For example:
+be implemented for the method to be supported. For example::
def get_host_uptime(self, ctxt, host):
topic = _compute_topic(self.topic, ctxt, host, None)
@@ -67,10 +68,11 @@ get_host_uptime() method.
Example 2) Adding a new parameter.
+----------------------------------
Adding a new parameter to an rpc method can be made backwards compatible. The
RPC_API_VERSION on the server side (nova/compute/manager.py) should be bumped.
-The implementation of the method must not expect the parameter to be present.
+The implementation of the method must not expect the parameter to be present.::
def some_remote_method(self, arg1, arg2, newarg=None):
# The code needs to deal with newarg=None for cases