SDN Controller Programming Guide
145
<include name="hm-rs/${project.version}/hm-
rs-${project.version}.war"/>
</fileset>
<fileset dir="${basedir}" includes="hm.plan"/>
</copy>
<zip destfile="target/hm-${project.version}.zip"
basedir="target/bundles"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
Trying the REST API with Curl
The following information illustrates a method to try the REST API created previously in Creating
Domain Service Resource (REST Interface of Business Logic Service) on page 137 using Curl [18].
See Curl on page 8 for installation instructions. Build and install the application as described in
Building Application on page 115 and Installing Application on page 116.
Execute the following command CURL Authentication Command to authenticate (And get an
authentication token). Then use the authentication token in the CURL GET Command to execute a
GET on the REST API described in Table 6. Figure 52 shows an execution example using
15.255.126.49 as the SDN controller address. The response returned by SwitchResource can be
seen as the output of the CURL GET Command.
NOTE
Use the correct password if it was changed following instructions from Authentication Configuration on
page 7.
CURL Authentication Command:
$ curl --noproxy [SDN_CONTROLLER_ADDRESS] -X POST --fail -ksSfL \
--url "https://[SDN_CONTROLLER_ADDRESS]:8443/sdn/v2.0/auth" \
-H "Content-Type: application/json" \
--data-binary \
'{"login":{"user":"sdn","password":"skyline","domain":"sdn"}}'
CURL GET Command:
$ curl --noproxy [SDN_CONTROLLER_ADDRESS] \