A cURL commands

The HP VAN SDN Controller provides a restful web service API. There are several tools available for accessing restful web service APIs, one of which is cURL. This sppendix shows examples of accessing the HP VAN SDN Controller's restful web service API with cURL. For details on installing the curl application, see http://curl.haxx.se/download.html.

The cURL application has many options, which are described in detail in the cURL manual (run "curl --manual") and at http://curl.haxx.se/docs/manpage.html. The examples in this appendix use minimal options and assume a non-scripted, command line mode of execution and no conflicts with a web proxy. Additional options can be used to customize your experience for your environment.

CAUTION: Credential information (user name, password, domain, and authentication tokens) used in cURL commands may be saved in the command history. For security reasons, HP recommends that you disable command history prior to executing commands containing credential information.

NOTE: The '-k' option should only be used when issuing the request against an HP VAN SDN Controller with a self-signed certificate, which is installed by default. If a CA signed certificate is installed, the '-k' option should not be used. See http://curl.haxx.se/docs/sslcerts.html for further details.

NOTE: Examples of cURL commands in this guide use the "--noproxy" option, which is appropriate where execution of cURL commands does not need a proxy to access controllers. If your network is set up such that a proxy is needed to access controllers, use the "--proxy" option. For details on cURL proxy options, visit http://curl.haxx.se/docs/manpage.html.

A.1 Export audit log data as a CSV file

To export the audit log use the following command:

curl [options] -H "X-Auth-Token: <token>"\ -H "Accept-Type: application/zip" \

https://<controller_ip>:8443/sdn/v2.0/auditlog \ -o <zip-file-name>

To acquire the token for the command, see “Installing, activating, uninstalling, or transferring licenses” (page 34).

For example, to export the current content in the controller audit log in a file named auditlogExport.CSV inside a zip file:

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \ -H "Accept-Type: application/zip" \ https://10.0.1.42:8443/sdn/v2.0/auditlog \

-o auditlogExport.zip

A.2 Licensing actions

A.2.1 Obtaining an install ID

To acquire the token for the command, see “Installing, activating, uninstalling, or transferring licenses” (page 34).

To obtain an Install ID:

112 cURL commands