Create use delete user session - HewlettPackard/python-ilorest-library GitHub Wiki
If not created already, create an instance of Rest or Redfish Object using the RestObject or RedfishObject class respectively. The class constructor takes iLO hostname/ ip address, iLO login username and password as arguments. The class also initializes a login session, gets systems resources and message registries.
Rest Object creation:
:
Redfish Object creation:
:
The method ex14_sessions takes an instance of rest object( or redfish object if using Redfish API ) , iLO login user name and iLO login password as arguments.
:
Create a new session dictionary with iLO login username and login password.
:
Sent a POST request to the URI '/rest/v1/Sessions' with the created session dictionary as request body to create a session.
:
For a successful response status get the session URI, session key from the response header. ILO returns lower case header names though HTTP headers are case insensitive.
:
Send DELETE request to the session URI in order to log out of the session and check the response status.
: