Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Next, we need to tell Karaf about our new command by editing shell-config.xml, located in ONOS_ROOT/cli/src/main/resources/OSGI-INF/blueprint/. We append add the following to the contents between the <command-bundle></command-bundle> clause in the file:

Code Block
languagexml
titleshell-config.xml
        <command>
            <!--Our command implementation's FQDN-->
            <action class="org.onlab.onos.cli.net.ForwardingMapCommand"/>
            <!--A command completer for Host IDs-->
            <completers>
                <ref component-id="hostIdCompleter"/>
                <null/>
            </completers>
        </command>

Returning to our directory structure diagram, our collection of additions/modifications are:

Code Block
languagetext
ONOS_ROOT/apps/pom.xml (apps parent POM)
         |    |  
         |    /ifwd/pom.xml (application POM)
         |         |
         |         /src/main/java/org/onlab/onos/ifwd/IntentReactiveForwarding.java (the application)
         |             |                             |
         |             |                             /package-info.java (optional documentation/annotations)
         |             |
         |             /test/java/org/onlab/onos/ifwd/ (Unit tests go here)
         |
         /core/api/src/main/java/org/onlab/onos/net/apps/ForwardingMapService.java (the service interface)
         |
         /cli/src/main/java/org/onlab/onos/cli/net/ForwardingMapCommand.java (the command)
                      |
                      /resources/OSGI-INF/blueprint/shell-config.xml (Karaf shell configuration)  

Verification

Once we rebuild ONOS, we can test our command out. 

...