
Getting an authorization token using a curl command
To get an authorization token using curl:
1.
Execute the following command:
curl --noproxy
controller_ip
-X POST --fail -ksSfL --url
"https://
controller_ip
:8443/sdn/v2.0/auth" -H "Content-Type:
application/json" --data-binary '{"login": {"domain":
"
domain
","user": "
user
","password": "
password
"}}'
The output of the curl command contains the token.
2.
Without including the quotation marks, copy the value displayed for
token
.
Example input:
$
curl --noproxy 10.1.1.10 -X POST --fail -ksSfL \
--url "https://10.1.1.10:8443/sdn/v2.0/auth" \
-H "Content-Type: application/json" \
--data-binary \
'{"login":{"user":"sdn","password":"skyline","domain":"sdn"}}'
Example output:
{"record":{"token":"237c78769e464508895f51410881ef26",
”expiration":1368749850000,"expirationDate":"2013–05–16 17–17–30 —0700",
"userID":"a4fc1cecad844bc280953f983bbdcc26","userName":"sdn",
"domainID":"ba4e20f1c232401e8f75e9f318c0ae8a","domainName":"sdn"}}
More information
“About the curl commands in this document” (page 170)
“Default domain name, user name, and password” (page 22)
Export audit log data as a CSV file using curl commands
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
“Getting an authorization token using a curl command”
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
Licensing actions using curl commands
Obtaining an install ID
To acquire the token for the command, see
“Getting an authorization token using a curl command”
To obtain an Install ID:
Getting an authorization token using a curl command
171