mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 18:04:02 -07:00
Expose timeout option to Redfish modules (#54130)
* added timeout option to Redfish modules * Apply suggestions from code review Removed 'required: false' and added 'type: int' to 'timeout' documentation string. Co-Authored-By: billdodd <billdodd@gmail.com>
This commit is contained in:
parent
a47edc9968
commit
d8536e47d3
5 changed files with 57 additions and 13 deletions
|
@ -68,6 +68,12 @@ options:
|
|||
required: false
|
||||
description:
|
||||
- bootdevice when setting boot configuration
|
||||
timeout:
|
||||
description:
|
||||
- Timeout in seconds for URL requests to OOB controller
|
||||
default: 10
|
||||
type: int
|
||||
version_added: '2.8'
|
||||
|
||||
author: "Jose Delarosa (@jose-delarosa)"
|
||||
'''
|
||||
|
@ -121,13 +127,14 @@ EXAMPLES = '''
|
|||
id: "{{ id }}"
|
||||
new_password: "{{ new_password }}"
|
||||
|
||||
- name: Clear Manager Logs
|
||||
- name: Clear Manager Logs with a timeout of 20 seconds
|
||||
redfish_command:
|
||||
category: Manager
|
||||
command: ClearLogs
|
||||
baseuri: "{{ baseuri }}"
|
||||
username: "{{ username }}"
|
||||
password: "{{ password }}"
|
||||
timeout: 20
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
@ -167,6 +174,7 @@ def main():
|
|||
new_password=dict(no_log=True),
|
||||
roleid=dict(),
|
||||
bootdevice=dict(),
|
||||
timeout=dict(type='int', default=10)
|
||||
),
|
||||
supports_check_mode=False
|
||||
)
|
||||
|
@ -184,10 +192,13 @@ def main():
|
|||
'userpswd': module.params['new_password'],
|
||||
'userrole': module.params['roleid']}
|
||||
|
||||
# timeout
|
||||
timeout = module.params['timeout']
|
||||
|
||||
# Build root URI
|
||||
root_uri = "https://" + module.params['baseuri']
|
||||
rf_uri = "/redfish/v1/"
|
||||
rf_utils = RedfishUtils(creds, root_uri)
|
||||
rf_utils = RedfishUtils(creds, root_uri, timeout)
|
||||
|
||||
# Check that Category is valid
|
||||
if category not in CATEGORY_COMMANDS_ALL:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue