SDN Controller Programming Guide

114
Application Generator (Automatic Workspace
Creation)
The HP VAN SDN Controller SDK also contains a utility to generate a skeletal application project
structure as a starting template for your custom projects - automatizing all previous steps to create
the application workspace. The generated application builds and installs into the HP VAN SDN
Controller without any modifications.
The tool allows you to tailor your template application using the parameters listed in Table 4.
Table 4 Sample Application Generator Parameters
Parameter
Description
target
Target where the application code is to be generated
app
One word application name in lower-case, for example, 'hm'
company
One word company name in lower-case, for example, 'hp'
subject
One word short subject in camel-case, for example, 'OpenFlowSwitch'
app-name
Optional full application name, for example, 'Health Monitor'
company-name
Optional full company name, for example, 'Hewlett-Packard'
app-description
Optional brief description of the application
rest-path
Optional REST API path , e.g. 'health'
To protect any existing code customizations, the 'target' 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 we use the application generator.
$ bin/gen-sdn-app ~/dev/sdn-apps/health-monitor hm hp OpenFlowSwitch \
"Device Health Monitor" "Hewlett-Packard" \
"Application for monitoring health of network devices." health
When executing the command with no parameters the command’s documentation displays, which
is very useful since the number of parameters is quite big and it is hard to remember them.