
First create an instance of Rest or Redfish Object using the RestObject or RedfishObject class respectively. The class constructor takes iLO hostname/ ip address formatted as a string (“https://xx.xx.xx.xx”), iLO login username and password as arguments. The class also initializes a login session, gets systems resources and message registries.
Rest Object creation:
REST_OBJ = RestObject(iLO_https_host, login_account, login_password)
Redfish Object creation:
REDFISH_OBJ = RedfishObject(iLO_https_host, login_account, login_password)
Example 45: Get license keyΒΆ
The method ex45_get_license_key takes an instance of rest object (or redfish object if using Redfish API) as argument.
def ex45_get_license_key(restobj):
Find and get the system resource for HpSmartStorageArrayController.
instances = restobj.search_for_type("HpiLOLicense.")
Create a dictionary to hold license results. Create a list of license properties.
license_result = dict()
licenseproperties = ["License", "LicenseKey", "LicenseType"]
Send HTTP GET request to the system URI(s).
for instance in instances:
response = restobj.rest_get(instance["href"])
For each license property, check the license property from the response body. Then print the value.
for licenseproperty in licenseproperties:
sys.stdout.write("\t" + licenseproperty + ": " + \
str(response.dict[licenseproperty]) + "\n")