Cookies, Cache controls, Logging in – HP StoreEver ESL G3 Tape Libraries User Manual
Page 11: Logging out, Cookies cache controls logging in logging out

Table 1 HTTP status code description (continued)
Description
HTTP status code
The server is refusing to service the request because the
entity of the request is in a format not supported by the
requested resource for the requested method.
415 Unsupported Media Type
The server encountered an unexpected condition which
prevented it from fulfilling the request.
500 Internal Server Error
Cookies
After successfully logging in to the WS interface the response header data will contain a cookie.
This cookie needs to be used on each successive http/https request. This cookie is used for
authentication after the initial login.
Cache Controls
All responses have Cache Controls turned off, so no caching mechanisms are provided through
the WS interface.
Logging in
To use the ESL G3 Web Services interface, you must first log in. You need to know the IP address
or DNS name of the library, a user name and password.
To log in, issue an HTTP POST to the IP address or DNS name of the library with
/aml/users/login
appended to the URL, and with data name=XXX&password=YYY, where
XXX is the user name (typically admin) and YYY is the password. Upon successful completion, a
cookie string will be returned. You must retain the cookie to issue commands after logging in.
For example, using the curl utility, where –v enables verbose output, -c specifies a filename to store
the received cookie, and –d specifies the data:
curl -v -c cookie.txt –X POST -d "name=admin&password=yyyy"
http://library1.mydomain.com/aml/users/login | xml fo
The library will return:
< HTTP/1.1 200 OK
< Cache-Control: no-cache, no-store
< Set-Cookie:
QUser=admin:241653285609122604979001250520081742384:192.168.1.23;Version=1;
Comment="AML WebService";Path=/aml
< Content-Type: application/xml
< Content-Length: 283
< Server: Jetty(7.6.10.v20130312)
200
Logging out
If a Web Services session is idle for too long, the library will automatically log out and disconnect
the session. The maximum idle length can be configured in the library’s GUI.
To log out of an active session, issue an HTTP DELETE to the IP address or DNS name of the library
with /aml/users/login appended to the URL. The cookie provided at login must also be
included in the HTTP DELETE to specify which session to log out.
Cookies
11