HP Insight Control Server Provisioning 7.3 Update 1 Installation Guide

Table Of Contents
The REST API allows you to upload a file to your appliance, and then you can use the Update
Appliance screen to install the update. Refer to the HP Insight Control Server Provisioning
Administrator Guide chapter on Advanced Topics for more information on REST APIs.
This section includes examples using cURL, as well as a sample PowerShell script that can be used
for uploading files to the appliance.
NOTE: cURL is part of most Linux installations and can be downloaded for Windows at http://
curl.haxx.se/. PowerShell is part of most newer Windows installations.
REST call to log in and get a user authorization token
All REST (Representational State Transfer) calls require that you first log in and get a user
authorization token, perform your intended REST call, and then log out.
The REST call to create the user session and get the authorization token requires you to provide
the following inputs:
appliance hostname or address
appliance administrator user name and password
The REST call will respond with a user authorization token that is used in the REST call to upload
the .bin file.
To execute the REST call to create a user session and generate an authorization token you invoke
cURL . An example for Linux and an example for Windows is shown below along with the associated
responses:
cURL command on Linux:
curl -i -k -H "accept: application/json" -H "content-type: application/json"
-H "accept-language: en-us" -X POST
https://<appliance-hostname-or-address>/rest/login-sessions?action=login
-d '{"userName":"<administrator-user>","password":"<administrator-password>"}'
Response on success:
HTTP/1.1 200 OK
Date: Fri, 08 Feb 2013 20:44:01 GMT
Content-Type: application/json
Via: 1.1 cic.dns.hp
cache-control: no-cache
Transfer-Encoding: chunked
{"sessionID":"<user-authorization-token>"}
cURL command on Windows:
curl -i -k -H "accept: application/json" -H "content-type: application/json"
-H "accept-language: en-us" -X POST
https://<appliance-hostname-or-address>/rest/login-sessions?action=login
-d {\"userName\":\"<administrator-user>\",\"password\":\"<administrator-password>\"}
REST call to upload the file
Next you execute the REST call to upload the file.
You will need to provide the following:
Appliance hostname or address
The user authorization token generated with the previous REST call.
In the Request Body, use —F option to supply form data with the absolute path to the file you are
uploading, depending on your system type, for example:
-F file=”@c:/IC-server-provisioning-7.3.1-update.bin (Windows)
REST API call to upload the update file 35