•
•
•
Establishing a Session, on page 48
•
Accessing the Session Details, on page 49
•
Accessing Details of a Particular Session, on page 49
•
•
•
•
Powering Off a Server, on page 50
•
Powering On a Server, on page 50
•
Clearing an SEL Log, on page 50
Establishing Session-based Authentication
Request:
curl -XPOST https://10.10.10.10/redfish/v1/SessionService/
Sessions --header "Content-Type: application/json;
charset=utf-8" -d'{"UserName": "admin", "Password": "admin123456"}'
--insecure -v
Response:
* About to connect() to 10.10.10.10 port 222 (#0)
*
Trying 10.10.10.10... connected
* Connected to 10.10.10.10 (10.10.10.10) port 222 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA256
* Server certificate:
* subject: E=null@null,CN=VASU-SL2,OU=PID,O=Cisco
Self Signed,L=San Jose,ST=California,C=US
* start date: Dec 08 05:21:25 2016 GMT
* expire date: Dec 07 05:21:25 2021 GMT
* common name: VASU-SL2
* issuer: E=null@null,CN=VASU-SL2,OU=PID,
O=Cisco Self Signed,L=San Jose,ST=California,C=US
> POST /redfish/v1/SessionService/Sessions HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu)
libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: 10.10.10.10
> Accept: */*
> Content-Type: application/json; charset=utf-8
> Content-Length: 47
>
< HTTP/1.1 200 OK
< Server: Monkey
< Date: Fri, 09 Dec 2016 06:01:12 GMT
Cisco UCS C-Series Servers REST API Programmer's Guide
7
Cisco IMC REST API Examples
Examples of Server Tasks