Logging out using curl

Procedure
Use the following curl command to access thelogoutresource of the switch:

Syntax:

curl [--noproxy] -k -X POST -b"https:///rest/v1/logout"

Options:

-k

指定旋度计划并不试图版本ify the server certificate against the list of certificate authorities included with the curl software.

The switch uses self-signed certificates. By default, the curl program attempts to verify certificates against its list of certificate authorities, and attempts to verify self-signed certificates fail. Therefore you must use the–koption to disable attempts to verify self-signed certificates against a certificate authority.

--noproxy

Optional. The--noproxyoption is appropriate where execution of curl commands does not need a proxy to access the applications. If your network is configured to require a proxy to access applications, use the--proxyoption.specifies the IP address or hostname of the switch.

-b

Specifies the file that contains the session cookie.

NOTE:

When you use curl, you log in at the beginning of your session and log out at the end of the session. When you log in, you must save the cookie returned from the login request so that you can pass that same cookie value to the switch in subsequent curl commands. When you log in, save the cookie file by specifying the-coption with a file name.

In subsequent curl commands, pass the cookie value back to the switch by specifying the-boption with the same file name.

-X

Specifies a method that curl would not use by default. Typically, used only with POST, PUT, or DELETE methods.

Example:

$curl --noproxy "192.0.2.5" -k -X POST \ -b /tmp/auth_cookie \ "https://192.0.2.5/rest/v1/logout"