-
Notifications
You must be signed in to change notification settings - Fork 94
Set ESKM username password
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:
REST_OBJ = RestObject(iLO_host, login_account, login_password)
Redfish Object creation:
REDFISH_OBJ = RedfishObject(iLO_host, login_account, login_password)
The method ex38_set_ESKM_username_password takes an instance of rest object ( or redfish object if using Redfish API ) and a ESKM username, password and account group settings as arguments.
def ex38_set_ESKM_username_password(restobj, username, password, accountgroup):
Find and get the ESKM settings URI from the systems resources collection.
instances = restobj.search_for_type("ESKM.")
For the ESKM settings, prepare the request body with the ESKM settings we want to change and perform the PATCH request.
for instance in instances:
body = dict()
body["KeyManagerConfig"] = dict()
body["KeyManagerConfig"]["LoginName"] = username
body["KeyManagerConfig"]["Password"] = password
body["KeyManagerConfig"]["AccountGroup"] = accountgroup
body["KeyManagerConfig"]["ESKMLocalCACertificateName"] = ""
response = restobj.rest_patch(instance["href"], body)
restobj.error_handler(response)
A successful PATCH response will set the ESKM settings to the new values provided in ESKM settings, however the changes will go into effect only after a system reset or reboot.