HP Insight Control Server Provisioning 7.2 Administrator Guide

DescriptionREST component
accept: application/jsonHTTP Headers:
content-type: application/json
accept-language: en-us (optional)
auth: <user-authorization-token>
where you supply <user-authorization-token>
{"type":"OSDIlo","username":”<iLO-administrator-user>,"password":
"<iLO-administrator-password>","port":<port>,"ipAddress":"<iLO-IP-address>"}
Request Body:
Type is the resource name.
You supply the <iLO-administrator-user>, <iLO-administrator-password>,
the port to use in connecting to iLO and the IPv4 <iLO-IP-address>
{"uri":"/rest/os-deployment-jobs/JobID"}
will return URI with Job ID.
Response Body:
You invoke cURL as follows and will see the associated response shown below:
cURL command on Linux:
curl -i -k -X POST -H "auth:${AUTH}" -H "content-type:application/json"
-H "accept:application/json" -H "accept-language:en-us"
https://<appliance-hostname-or-address>/rest/os-deployment-ilos?addstyle=old
-d {"type":"OSDIlo","username":"<iLO-administrator-user>,
password:<iLO-administrator-password>,
port:443,ipAddress:<iLO-IP-address>}
cURL command on Windows:
curl -i -k -X POST -H "auth: <user-authorization-toke>n" -H "content-type:application/json"
-H "accept:application/json" -H "accept-language:en-us"
https://<appliance-hostname-or-address>/rest/os-deployment-ilos?addstyle=old
-d {\"type\":\"OSDIlo\",\"username\":\"<iLO-administrator-user>\,
\password\:\<iLO-administrator-password>\,
\port\:443,\ipAddress\:\<iLO-IP-address>\}
Response on success:
HTTP/1.1 202 Accepted
Date: Wed, 20 Feb 2013 17:33:30 GMT
Content-Type: application/json
Via: 1.1 cic.dns.hp
cache-control: no-cache
Transfer-Encoding: chunked
This response is accompanied by returned job URI.
Below is an example script that logs into the appliance, adds the server via iLO and logs out. This
script uses cURL.
#!/bin/sh
# login
AUTH=`curl -k -X POST -H "accept:application/json" -H "content-type: application/json"
https://<appliance-hostname-or-address>/rest/login-sessions?action=login
-d '{"userName":"<administrator-name>","password":<administrator-password>"}' ' | perl -e 'while (<>)
{/{"sessionID":"(.*)"}/ && print $1;}'`
# This script invokes a job to add iLO-managed server.
curl -i -k -X POST -H "auth:${AUTH}" -H "content-type:application/json"
-H "accept:application/json" -H "accept-language:en-us"
https://<appliance-hostname-or-address>/rest/os-deployment-ilos/?addstyle=old
-d '{"type":"OSDIlo","username":"<iLO-administrator-user>","password":"<iLOadministrator-password>",
"port":443,"ipaddress":"<iLO-IP-address>"}'
# logout
curl -k -i -X DELETE -H "auth:${AUTH}"
https://<appliance-hostname-or-address>/rest/login-sessions?action=logout
5.1 REST APIs to enable HP Support access or add a server via iLO 39