Logon and Logoff
The Logon request establishes a trusted session with the Web Services APIs and the Logoff request disconnects or closes a session.
Resource
/rest/api/web/Logon
Since: Version 1_1_0
Logon request
The API receives UserID and Password as Logon Request and responds with X-API-Session. This establishes a valid user session. The X-API-Session must be used for all subsequent REST API calls.
Method | Description | Internet media type or content type |
---|---|---|
PUT | Valid credentials establishes web services session with the server and returns X-API-Session | application/vnd.ibm.powervm.web+xml;
type=LogonRequest |
Example request
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LogonRequest xmlns="http://www.ibm.com/xmlns/systems/power/firmware/web/mc/2012_10/"
schemaVersion="V1_1_0">
<Metadata>
<Atom/>
</Metadata>
<UserID kb="CUR" kxe="false">{hmc_user_id}</UserID>
<Password kb="CUR" kxe="false">{hmc_password}</Password>
</LogonRequest>
Example response
In case of successful execution the server returns response with X-API-Session.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LogonResponse xmlns="http://www.ibm.com/xmlns/systems/power/firmware/web/mc/2012_10/"
schemaVersion="V1_1_0">
<Metadata>
<Atom/>
</Metadata>
<X-API-Session kxe="false" kb="ROR">
gDHtF9lOmKjiHPkdaR0Bv4Ep1fXn8Qh4H8okf88pJgz9mVRT3hG_XD8Iu3d4fZ1KB95ytiNusdu
hpKSdMFXCBQgY4YcABiPyztI8ZZSTqk33bqDrDnmdrmJdyCXLWDYgFCIGs6Cba_fs7_83JvaVAb
V7zaTwmpiwfVD2r_8faiawZ2SiPNN9fDbvQHx0Z1S6KT92osIo4d09U2J1C4aJKtJWs65JcPkQD-wtunLa_j4=
</X-API-Session>
</LogonResponse>
In your all subsequent REST calls add the X-API-Session as a request header parameter to maintain the session.
Logoff request
Use the Logoff API after all the REST API operations are completed. Logoff URI deletes the current user session and removes X-API-Session token.
Method | Description |
---|---|
DELETE | This method is used to request the web server to delete the session. |