From 837aa03c4358e8fd86bbfed9f5e657366f4f7e2c Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 10 Jul 2013 09:31:45 +0100 Subject: [PATCH] Include docstrings in published docs Change-Id: Icdfb0535b26162d39c3af683b7729b5e834d89b9 --- doc/source/exceptions.rst | 18 ++++++++++++++++++ doc/source/index.rst | 10 ++++++++-- doc/source/notifier.rst | 8 ++++++++ doc/source/rpcclient.rst | 8 ++++++++ doc/source/serializer.rst | 10 ++++++++++ doc/source/server.rst | 14 ++++++++++++++ doc/source/target.rst | 7 +++++++ doc/source/transport.rst | 11 +++++++++++ oslo/messaging/rpc/server.py | 14 +++++++------- oslo/messaging/target.py | 2 +- 10 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 doc/source/exceptions.rst create mode 100644 doc/source/notifier.rst create mode 100644 doc/source/rpcclient.rst create mode 100644 doc/source/serializer.rst create mode 100644 doc/source/server.rst create mode 100644 doc/source/target.rst create mode 100644 doc/source/transport.rst diff --git a/doc/source/exceptions.rst b/doc/source/exceptions.rst new file mode 100644 index 000000000..02dd8de0e --- /dev/null +++ b/doc/source/exceptions.rst @@ -0,0 +1,18 @@ +---------- +Exceptions +---------- + +.. currentmodule:: oslo.messaging + +.. autoexception:: ClientSendError +.. autoexception:: DriverLoadFailure +.. autoexception:: ExecutorLoadFailure +.. autoexception:: InvalidTransportURL +.. autoexception:: MessagingException +.. autoexception:: MessagingTimeout +.. autoexception:: MessagingServerError +.. autoexception:: NoSuchMethod +.. autoexception:: RPCDispatcherError +.. autoexception:: RPCVersionCapError +.. autoexception:: ServerListenError +.. autoexception:: UnsupportedVersion diff --git a/doc/source/index.rst b/doc/source/index.rst index 71bfd0aa3..11ce1c320 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -5,12 +5,18 @@ The Oslo messaging API supports RPC and notifications over a number of different messsaging transports. Contents --------- +======== .. toctree:: :maxdepth: 1 - api/autoindex + transport + target + server + rpcclient + notifier + serializer + exceptions Release Notes ============= diff --git a/doc/source/notifier.rst b/doc/source/notifier.rst new file mode 100644 index 000000000..b55430f8a --- /dev/null +++ b/doc/source/notifier.rst @@ -0,0 +1,8 @@ +-------- +Notifier +-------- + +.. currentmodule:: oslo.messaging + +.. autoclass:: Notifier + :members: diff --git a/doc/source/rpcclient.rst b/doc/source/rpcclient.rst new file mode 100644 index 000000000..80730f5a3 --- /dev/null +++ b/doc/source/rpcclient.rst @@ -0,0 +1,8 @@ +---------- +RPC Client +---------- + +.. currentmodule:: oslo.messaging + +.. autoclass:: RPCClient + :members: diff --git a/doc/source/serializer.rst b/doc/source/serializer.rst new file mode 100644 index 000000000..5b02bbd18 --- /dev/null +++ b/doc/source/serializer.rst @@ -0,0 +1,10 @@ +---------- +Serializer +---------- + +.. currentmodule:: oslo.messaging + +.. autoclass:: Serializer + :members: + +.. autoclass:: NoOpSerializer diff --git a/doc/source/server.rst b/doc/source/server.rst new file mode 100644 index 000000000..64b19b828 --- /dev/null +++ b/doc/source/server.rst @@ -0,0 +1,14 @@ +------ +Server +------ + +.. automodule:: oslo.messaging.rpc.server + +.. currentmodule:: oslo.messaging + +.. autofunction:: get_rpc_server + +.. autoclass:: RPCDispatcher + +.. autoclass:: MessageHandlingServer + :members: diff --git a/doc/source/target.rst b/doc/source/target.rst new file mode 100644 index 000000000..ab4b72ba9 --- /dev/null +++ b/doc/source/target.rst @@ -0,0 +1,7 @@ +------ +Target +------ + +.. currentmodule:: oslo.messaging + +.. autoclass:: Target diff --git a/doc/source/transport.rst b/doc/source/transport.rst new file mode 100644 index 000000000..4c4b36080 --- /dev/null +++ b/doc/source/transport.rst @@ -0,0 +1,11 @@ +--------- +Transport +--------- + +.. currentmodule:: oslo.messaging + +.. autofunction:: get_transport + +.. autoclass:: Transport + +.. autofunction:: set_transport_defaults diff --git a/oslo/messaging/rpc/server.py b/oslo/messaging/rpc/server.py index 53eb8d103..943400e43 100644 --- a/oslo/messaging/rpc/server.py +++ b/oslo/messaging/rpc/server.py @@ -13,11 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -__all__ = ['get_rpc_server'] - -from oslo.messaging.rpc import dispatcher as rpc_dispatcher -from oslo.messaging import server as msg_server - """ An RPC server exposes a number of endpoints, each of which contain a set of methods which may be invoked remotely by clients over a given transport. @@ -25,7 +20,7 @@ methods which may be invoked remotely by clients over a given transport. To create an RPC server, you supply a transport, target and a list of endpoints. -A transport can be obtained simply by calling the get_transport() method: +A transport can be obtained simply by calling the get_transport() method:: transport = messaging.get_transport(conf) @@ -48,7 +43,7 @@ complete. An RPC server class is provided for each supported I/O handling framework. Currently BlockingRPCServer and eventlet.RPCServer are available. -A simple example of an RPC server with multiple endpoints might be: +A simple example of an RPC server with multiple endpoints might be:: from oslo.config import cfg from oslo import messaging @@ -94,6 +89,11 @@ return values from the methods. By supplying a serializer object, a server can deserialize arguments from - serialize return values to - primitive types. """ +__all__ = ['get_rpc_server'] + +from oslo.messaging.rpc import dispatcher as rpc_dispatcher +from oslo.messaging import server as msg_server + def get_rpc_server(transport, target, endpoints, executor='blocking', serializer=None): diff --git a/oslo/messaging/target.py b/oslo/messaging/target.py index 710b944a6..504ac932d 100644 --- a/oslo/messaging/target.py +++ b/oslo/messaging/target.py @@ -22,7 +22,7 @@ class Target(object): should be sent or what messages a server is listening for. Different subsets of the information encapsulated in a Target object is - relevant to various aspects of the API:: + relevant to various aspects of the API: creating a server: topic and server is required; exchange is optional