Reference Guide

Table Of Contents
--company-name
Optional full company name, for example, 'Hewlett-Packard'
--description
Optional brief description of the application
--rest-path
Optional REST API path , e.g. 'health'
--template
Template used to generate the application code, for example, ‘skeleton'
To protect any existing code customizations, the 'directory' parameter needs to denote a new
directory, that is, one that does not exist yet.
The 'app' and 'company' parameters need to be suitable for use in Java package names and
therefore should be all lowercase and not contain any spaces or special characters. Similarly, the
'subject' parameter needs to be suitable for use in Java class names and therefore should be in
camel-case and not contain any spaces or special characters either.
The following command shows how to use the application generator tool to build the sample
application.
NOTE:
The target directory must not contain spaces if the application generator is used.
$ bin/gen-sdn-app --directory /dev/sdm-apps/health-monitor --template skeleton \
--app hm --company hp --subject Switch --app-name “Device Health Monitor” \
--company-name “Hewlett Packard” --description “Application for monitoring \
health of network devices.--rest-path switches
When executing the command with no parameters the command’s documentation is displayed,
which is very useful since the number of parameters is quite big and it is hard to remember them.
The template sample application is ready to build and install. It serves as a good starting point to
new applications development.
To build the application simply change the working directory to the root module and use maven to
build the application as described below.
When Maven is finished, the application zip file can be found under the ~/sdn-hm/hm-
app/target directory. Use the SDN Controller GUI as described in Installing the Application on
page 147, to directly upload the application zip file and then ignite it.
Eclipse IDE project files can also be created automatically as described in Creating Eclipse
Projects.
Creating Eclipse Projects
Eclipse projects can be generated by executing the following Maven command from the
application root directory (~/dev/sdn-apps/health-monitor/hm-root for the sample application in
Linux):
$ mvn eclipse:eclipse
Once the maven command completes, the projects can be imported from within the Eclipse IDE,
see Importing Java Projects on page 243.
145