HP Insight Control Server Provisioning 7.3 Update 1 Administrator Guide

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
-d '{"type":"OSDIlo","username":"<administrator-name>","password":"<administrator-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
REST call to add a server via iLO and server will not boot into a maintenance mode:
A list of the components of the REST call is shown in the following table:
DescriptionREST component
https://<appliance-hostname-or-address>/rest/os-deployment-ilos/?addstyle=old
where you supply <appliance-hostname-or-address>
URL:
POSTMessage Type:
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 can invoke cURL with the following associated responses:
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
102 Advanced topics