curl commands

The HPE 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 appendix shows some examples of accessing the 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.


[NOTE: ]

NOTE: The -k option should only be used when issuing the request against an HPE 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.



[CAUTION: ]

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



[NOTE: ]

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.


The following sections describe some typical curl commands:

About the curl commands in this document

  • The backslash (\) character at the end of the line indicates that the command continues on the next line. In the Bash shell, which you use to enter curl commands, a backslash character that is followed by the newline character is removed from the input stream automatically such that the command is processed as if it were entered on a single line.

  • When using a command in Ubuntu, ensure that you replace any curly or smart quotation marks (“ “) with straight quotation marks (").

  • Examples of curl commands in this document 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.

  • Examples of curl commands in this document use the default user name and password for the controller. Your controller user names and passwords might have been changed.

For information about curl proxy options, see the manpages for curl.

More information
Default domain name, user name, and password
http://curl.haxx.se/docs/manpage.html