Merge "Remove OpFlex out of Fluorine."
[docs.git] / docs / developer-guide / topology-processing-framework-developer-guide.rst
index 9ee838bc79b80bb1b6a8230f8d5402495348e8e0..ae5decbefee5d238a6e173f2461ef4a09d419576 100644 (file)
@@ -1,3 +1,5 @@
+.. _topoprocessing-dev-guide:
+
 Topology Processing Framework Developer Guide
 =============================================
 
@@ -389,7 +391,7 @@ purpose is to create new overlay links based on the links from the
 underlay topologies and underlay items from overlay items. The required
 information for Link Computation is provided via the Link Computation
 model in
-(`topology-link-computation.yang <https://git.opendaylight.org/gerrit/gitweb?p=topoprocessing.git;a=blob;f=topoprocessing-api/src/main/yang/topology-link-computation.yang;hb=refs/heads/stable/beryllium>`__).
+(`topology-link-computation.yang <https://git.opendaylight.org/gerrit/gitweb?p=topoprocessing.git;a=blob;f=topoprocessing-api/src/main/yang/topology-link-computation.yang;hb=refs/heads/stable/boron>`__).
 
 Link Computation Functionality
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -466,7 +468,7 @@ pieces are:
 
 -  output model
 
-.. code:: yang
+.. code::
 
     leaf output-model {
         type identityref {
@@ -477,7 +479,7 @@ pieces are:
 
 -  overlay topology with new nodes
 
-.. code:: yang
+.. code::
 
     container node-info {
         leaf node-topology {
@@ -491,7 +493,7 @@ pieces are:
 
 -  underlay topologies with original links
 
-.. code:: yang
+.. code::
 
     list link-info {
         key "link-topology input-model";
@@ -715,7 +717,7 @@ picture below shows how data will be rendered and stored.
 
    Rendering to the inventory-rendering model
 
-    **Important**
+.. important::
 
     When implementing your version of the topology-rendering model in
     the Topology Processing Framework, the source file of the model
@@ -728,7 +730,7 @@ which you can set your new model as output model. To do that you have to
 add another identity item to topology-correlation.yang file. For our
 inventory-rendering model identity looks like this:
 
-.. code:: yang
+.. code::
 
     identity inventory-rendering-model {
         description "inventory-rendering.yang";
@@ -741,7 +743,7 @@ model in XML.
 Step2 - Module and Feature Creation
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-    **Important**
+.. important::
 
     This and following steps are based on the `model specific
     approach <#_model_specific_approach>`__ in the Topology Processing
@@ -813,7 +815,7 @@ IRModelAdapter refers to class which implements ModelAdapter in module
 Inventory Rendering). In the case of the provider class, we put the
 abbreviation at the end.
 
-    **Important**
+.. important::
 
     -  In the next sections, we use the terms TopologyRequestListener,
        TopologyRequestHandler, etc. without a prepended or appended
@@ -877,7 +879,7 @@ processing. In this case, we had to create five classes implementing:
    the rendering operator just wraps each received UnderlayItem to
    OverlayItem and sends them to write.
 
-    **Important**
+.. important::
 
     For purposes of topology rendering from inventory to
     network-topology, there are misused fields in UnderlayItem as
@@ -934,14 +936,45 @@ only one OverlayItem and one UnderlayItem in the corresponding lists.
 Testing
 ~~~~~~~
 
-If you want to test our implementation you must apply `this
-patch <https://git.opendaylight.org/gerrit/#/c/26612>`__. It adds an
-OpenFlow Plugin dependency so we can use it in the Karaf distribution as
-a feature. After adding patch and building the whole framework, you can
-start Karaf. Next, you have to install necessary features. In our case
-it is:
+If you want to test topoprocessing with some manually created underlay
+topologies (like in this guide), than you have to tell Topoprocessing
+to listen for underlay topologies on Configuration datastore
+instead of Operational.
+
+| You can do this in this config file
+| ``<topoprocessing_directory>/topoprocessing-config/src/main/resources/80-topoprocessing-config.xml``.
+| Here you have to change
+| ``<datastore-type>OPERATIONAL</datastore-type>``
+| to
+| ``<datastore-type>CONFIGURATION</datastore-type>``.
+
+
+Also you have to add dependency required to test "inventory" topologies.
+
+| In ``<topoprocessing_directory>/features/pom.xml``
+| add ``<openflowplugin.version>latest_snapshot</openflowplugin.version>``
+  to properties section
+| and add this dependency to dependencies section
+
+.. code:: xml
+
+        <dependency>
+                <groupId>org.opendaylight.openflowplugin</groupId>
+                <artifactId>features-openflowplugin</artifactId>
+                <version>${openflowplugin.version}</version>
+                <classifier>features</classifier><type>xml</type>
+        </dependency>
+
+``latest_snapshot`` in ``<openflowplugin.version>`` replace with latest snapshot, which can be found `here <https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/openflowplugin/openflowplugin/>`__.
+
+| And in ``<topoprocessing_directory>/features/src/main/resources/features.xml``
+| add ``<repository>mvn:org.opendaylight.openflowplugin/features-openflowplugin/${openflowplugin.version}/xml/features</repository>``
+  to repositories section.
+
+Now after you rebuild project and start Karaf, you can install necessary features.
 
-``feature:install odl-restconf-noauth odl-topoprocessing-inventory-rendering odl-openflowplugin-southbound odl-openflowplugin-nsf-model``
+| You can install all with one command:
+| ``feature:install odl-restconf-noauth odl-topoprocessing-inventory-rendering odl-openflowplugin-southbound odl-openflowplugin-nsf-model``
 
 Now you can send messages to REST from any REST client (e.g. Postman in
 Chrome). Messages have to have following headers:
@@ -1228,6 +1261,12 @@ is:
         </topology>
     </network-topology>
 
+Use Cases
+---------
+
+You can find use case examples on `this wiki page
+<https://wiki.opendaylight.org/view/Topology_Processing_Framework:Developer_Guide:Use_Case_Tutorial>`__.
+
 Key APIs and Interfaces
 -----------------------
 
@@ -1239,5 +1278,4 @@ API Reference Documentation
 ---------------------------
 
 You can find API examples on `this wiki
-page <https://wiki.opendaylight.org/view/Topology_Processing_Framework:Developer_Guide:End_to_End_Example>`__.
-
+page <https://wiki.opendaylight.org/view/Topology_Processing_Framework:Developer_Guide:REST_API_Specification>`__.