HP Insight Control Server Provisioning 7.3 Update 1 Administrator Guide

A list of the components of the REST call is shown in the following table:
DescriptionREST component
https://<appliance-hostname-or-address>/rest/appliance/settings/enableServiceAccess
where you supply <appliance-hostname-or-address>
URL:
PUTMessage Type:
accept: application/jsonHTTP Headers:
content-type: application/json
accept-language: en-us (optional)
auth: <user-authorization-token>
where you supply <user-authorization-token>
<true/false>
specifying whether you want support access enabled
Request Body:
“true
if services access was successfully enabled or disabled
Response Body:
You can invoke cURL with the following associated responses:
cURL command on Linux:
curl -i -k -H "accept: application/json" -H "content-type: application/json"
-H "accept-language:en-us"
-H "auth: <user-authorization-token>" -X PUT
https://<appliance-hostname-or-address>/rest/appliance/settings/enableServiceAccess
-d "true/false"
cURL command on Windows:
curl -i -k -H "accept: application/json" -H "content-type: application/json"
-H "accept-language:en-us"
-H "auth: <user-authorization-token>" -X PUT
https://<appliance-hostname-or-address>/rest/appliance/settings/enableServiceAccess
-d \"<true/false>\
Response on success:
HTTP/1.1 200 OK
Date: Fri, 08 Feb 2013 20:46:13 GMT
Content-Type: application/json
Via: 1.1 cic.dns.hp
cache-control: no-cache
Transfer-Encoding: chunked
True
If the request fails, you will be returned an error diagnostics. Common errors are HTTP error 404
not found, if the URL is not correct, or an exception if the associated user is not authorized to
enable/disable services access.
Below is an example Linux shell script using cURL that logs into the appliance, enables or disables
support access and logs out.
#!/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=logout
-d '{"userName":"<administrator-name>","password":"<administrator-password>"}' | perl -e 'while (<>)
{/{"sessionID":"(.*)"}/ && print $1;}'`
# This REST call either enables or disables support access to the appliance.
curl -i -k -H "accept:application/json" -H "content-type:application/json"
-H "accept-language:en-us"
-H "auth: ${AUTH}" -X PUT
106 Advanced topics