mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-20 09:21:24 -07:00
Redfish: Added support for displaying and setting account types (#6871)
* Redfish: Added support for displaying and setting account types Signed-off-by: Mike Raineri <michael.raineri@dell.com> * Update 6823-redfish-add-account-type-management.yml * CI fixes Signed-off-by: Mike Raineri <michael.raineri@dell.com> --------- Signed-off-by: Mike Raineri <michael.raineri@dell.com>
This commit is contained in:
parent
0ae8f9d631
commit
9adc82d5d1
3 changed files with 55 additions and 7 deletions
|
@ -1140,7 +1140,8 @@ class RedfishUtils(object):
|
|||
user_list = []
|
||||
users_results = []
|
||||
# Get these entries, but does not fail if not found
|
||||
properties = ['Id', 'Name', 'UserName', 'RoleId', 'Locked', 'Enabled']
|
||||
properties = ['Id', 'Name', 'UserName', 'RoleId', 'Locked', 'Enabled',
|
||||
'AccountTypes', 'OEMAccountTypes']
|
||||
|
||||
response = self.get_request(self.root_uri + self.accounts_uri)
|
||||
if response['ret'] is False:
|
||||
|
@ -1191,6 +1192,10 @@ class RedfishUtils(object):
|
|||
payload['Password'] = user.get('account_password')
|
||||
if user.get('account_roleid'):
|
||||
payload['RoleId'] = user.get('account_roleid')
|
||||
if user.get('account_accounttypes'):
|
||||
payload['AccountTypes'] = user.get('account_accounttypes')
|
||||
if user.get('account_oemaccounttypes'):
|
||||
payload['OEMAccountTypes'] = user.get('account_oemaccounttypes')
|
||||
return self.patch_request(self.root_uri + uri, payload, check_pyld=True)
|
||||
|
||||
def add_user(self, user):
|
||||
|
@ -1221,6 +1226,10 @@ class RedfishUtils(object):
|
|||
payload['Password'] = user.get('account_password')
|
||||
if user.get('account_roleid'):
|
||||
payload['RoleId'] = user.get('account_roleid')
|
||||
if user.get('account_accounttypes'):
|
||||
payload['AccountTypes'] = user.get('account_accounttypes')
|
||||
if user.get('account_oemaccounttypes'):
|
||||
payload['OEMAccountTypes'] = user.get('account_oemaccounttypes')
|
||||
if user.get('account_id'):
|
||||
payload['Id'] = user.get('account_id')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue