Heading ======= is reserved for a title of document.
This commit replaces non-title headings with lower headings.
Change-Id: I8521cde527ac3387e42e9e2f262506a5872484a0
determine if they wish to support the functionality or not.
Examples
-========
+--------
The easiest way to demonstrate how an API extension is written, is
by studying an existing API extension and explaining the different layers.
Subscribing to events
-=====================
+---------------------
Imagine that you have entity A, B, and C that have some common business over router creation.
A wants to tell B and C that the router has been created and that they need to get on and
Subscribing and aborting events
-===============================
+-------------------------------
Interestingly in Neutron, certain events may need to be forbidden from happening due to the
nature of the resources involved. To this aim, the callback-based mechanism has been designed
Unsubscribing to events
-=======================
+-----------------------
There are a few options to unsubscribe registered callbacks:
FAQ
-===
+---
Can I use the callbacks registry to subscribe and notify non-core resources and events?
.
Service side design
-===================
+-------------------
+
* neutron.extensions.qos:
base extension + API controller definition. Note that rules are subattributes
of policies and hence embedded into their URIs.
Supported QoS rule types
-------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~
Any plugin or Ml2 mechanism driver can claim support for some QoS rule types by
providing a plugin/driver class property called 'supported_qos_rule_types' that
Database models
----------------
+~~~~~~~~~~~~~~~
QoS design defines the following two conceptual resources to apply QoS rules
for a port or a network:
QoS versioned objects
----------------------
+~~~~~~~~~~~~~~~~~~~~~
There is a long history of passing database dictionaries directly into business
logic of Neutron. This path is not the one we wanted to take for QoS effort, so
RPC communication
------------------
+~~~~~~~~~~~~~~~~~
+
Details on RPC communication implemented in reference backend driver are
discussed in `a separate page <rpc_callbacks.html>`_.
Agent side design
-=================
+-----------------
To ease code reusability between agents and to avoid the need to patch an agent
for each new core resource extension, pluggable L2 agent extensions were
Agent backends
---------------
+~~~~~~~~~~~~~~
At the moment, QoS is supported by Open vSwitch and SR-IOV ml2 drivers.
Open vSwitch
-~~~~~~~~~~~~
+++++++++++++
Open vSwitch implementation relies on the new ovs_lib OVSBridge functions:
combination with openflow rules.
SR-IOV
-~~~~~~
+++++++
SR-IOV bandwidth limit implementation relies on the new pci_lib function:
Configuration
-=============
+-------------
To enable the service, the following steps should be followed:
Testing strategy
-================
+----------------
All the code added or extended as part of the effort got reasonable unit test
coverage.
Neutron objects
----------------
+~~~~~~~~~~~~~~~
Base unit test classes to validate neutron objects were implemented in a way
that allows code reuse when introducing a new object type.
Functional tests
-----------------
+~~~~~~~~~~~~~~~~
Additions to ovs_lib to set bandwidth limits on ports are covered in:
API tests
----------
+~~~~~~~~~
API tests for basic CRUD operations for ports, networks, policies, and rules were added in:
RPC APIs are defined in Neutron in two parts: client side and server side.
Client Side
-===========
+-----------
Here is an example of an rpc client definition:
this request.
Server Side
-===========
+-----------
The server side of an rpc interface looks like this:
version 1.1 of the interface.
Versioning
-==========
+----------
Note that changes to rpc interfaces must always be done in a backwards
compatible way. The server side should always be able to handle older clients
https://wiki.openstack.org/wiki/RpcMajorVersionUpdates.
Example Change
---------------
+~~~~~~~~~~~~~~
As an example minor API change, let's assume we want to add a new parameter to
my_remote_method_2. First, we add the argument on the server side. To be
arg1=arg1, arg2=arg2)
Neutron RPC APIs
-================
+----------------
As discussed before, RPC APIs are defined in two parts: a client side and a
server side. Several of these pairs exist in the Neutron code base. The code
that indicates where the corresponding server or client code is located.
Example: DHCP
--------------
+~~~~~~~~~~~~~
The DHCP agent includes a client API, neutron.agent.dhcp.agent.DhcpPluginAPI.
The DHCP agent uses this class to call remote methods back in the Neutron
neutron.agent.dhcp.agent.DhcpAgent.
More Info
-=========
+---------
For more information, see the oslo.messaging documentation:
http://docs.openstack.org/developer/oslo.messaging/.
'versioned_object.namespace': 'versionedobjects'}
Topic names for every resource type RPC endpoint
-================================================
+------------------------------------------------
neutron-vo-<resource_class_name>-<version>
to only get interesting information to them.
Subscribing to resources
-========================
+------------------------
Imagine that you have agent A, which just got to handle a new port, which
has an associated security group, and QoS policy.
which are uninteresting to them.
Unsubscribing from resources
-============================
+----------------------------
To unsubscribe registered callbacks:
Sending resource events
-=======================
+-----------------------
On the server side, resource updates could come from anywhere, a service plugin,
an extension, anything that updates, creates, or destroys the resource and that
References
-==========
+----------
+
.. [#ov_serdes] https://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/tests/test_objects.py#L621
.. [#vo_mkcompat] https://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/base.py#L460
.. [#vo_mkcptests] https://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/tests/test_objects.py#L111