...
Code Block | ||
---|---|---|
| ||
onos> app activate org.foo.app onos> apps -s ... * 29 org.foo.app 1.0.SNAPSHOT ONOS OSGi bundle archetype |
Overlays
ONOS applications can hook into the ONOS CLI and GUI. When generating your application, you can use overlays to generate the classes needed to give your application access to these services.
CLI Overlay
To allow your application access to the ONOS CLI, overlay the CLI interface like this:
Code Block | ||
---|---|---|
| ||
onos-create-app cli org.foo.app foo-app 1.0.0 |
Now, as before, we need to build and install our application. Since we installed it once already, we will use the reinstall command to deploy it:
Code Block | ||
---|---|---|
| ||
mvn clean install
onos-app localhost reinstall target/foo-app-1.0-SNAPSHOT.oar |
Using the ONOS command line, restart the application:
Code Block |
---|
onos> app activate org.foo.app |
Using the ONOS command line, we now have access to the 'sample' command, which was defined by our overlay:
Code Block |
---|
onos> sample
Hello World |
Happy coding
Finally your application is loaded and running withing ONOS. Also, the generation process has generated an entire project which can be loaded into your favourite JAVA editor.
...