| 1 |
.. _ome_job_info_module: |
| 2 |
|
| 3 |
|
| 4 |
ome_job_info -- Get job details for a given job ID or an entire job queue on OpenMange Enterprise |
| 5 |
================================================================================================= |
| 6 |
|
| 7 |
.. contents:: |
| 8 |
:local: |
| 9 |
:depth: 1 |
| 10 |
|
| 11 |
|
| 12 |
Synopsis |
| 13 |
-------- |
| 14 |
|
| 15 |
This module retrieves job details for a given job ID or an entire job queue on OpenMange Enterprise. |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
Requirements |
| 20 |
------------ |
| 21 |
The below requirements are needed on the host that executes this module. |
| 22 |
|
| 23 |
- python \>= 3.9.6 |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
Parameters |
| 28 |
---------- |
| 29 |
|
| 30 |
job_id (optional, int, None) |
| 31 |
Unique ID of the job. |
| 32 |
|
| 33 |
|
| 34 |
system_query_options (optional, dict, None) |
| 35 |
Options for pagination of the output. |
| 36 |
|
| 37 |
|
| 38 |
top (optional, int, None) |
| 39 |
Number of records to return. Default value is 100. |
| 40 |
|
| 41 |
|
| 42 |
skip (optional, int, None) |
| 43 |
Number of records to skip. Default value is 0. |
| 44 |
|
| 45 |
|
| 46 |
filter (optional, str, None) |
| 47 |
Filter records by the values supported. |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
fetch_execution_history (optional, bool, False) |
| 52 |
Fetches the execution history of the job. |
| 53 |
|
| 54 |
\ :emphasis:`fetch\_execution\_history`\ is only applicable when valid \ :emphasis:`job\_id`\ is given. |
| 55 |
|
| 56 |
When \ :literal:`true`\ , fetches all the execution history details. |
| 57 |
|
| 58 |
When \ :literal:`false`\ , fetches only the job info and last execution details. |
| 59 |
|
| 60 |
|
| 61 |
hostname (True, str, None) |
| 62 |
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. |
| 63 |
|
| 64 |
|
| 65 |
username (False, str, None) |
| 66 |
OpenManage Enterprise or OpenManage Enterprise Modular username. |
| 67 |
|
| 68 |
If the username is not provided, then the environment variable \ :envvar:`OME\_USERNAME`\ is used. |
| 69 |
|
| 70 |
Example: export OME\_USERNAME=username |
| 71 |
|
| 72 |
|
| 73 |
password (False, str, None) |
| 74 |
OpenManage Enterprise or OpenManage Enterprise Modular password. |
| 75 |
|
| 76 |
If the password is not provided, then the environment variable \ :envvar:`OME\_PASSWORD`\ is used. |
| 77 |
|
| 78 |
Example: export OME\_PASSWORD=password |
| 79 |
|
| 80 |
|
| 81 |
x_auth_token (False, str, None) |
| 82 |
Authentication token. |
| 83 |
|
| 84 |
If the x\_auth\_token is not provided, then the environment variable \ :envvar:`OME\_X\_AUTH\_TOKEN`\ is used. |
| 85 |
|
| 86 |
Example: export OME\_X\_AUTH\_TOKEN=x\_auth\_token |
| 87 |
|
| 88 |
|
| 89 |
port (optional, int, 443) |
| 90 |
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. |
| 91 |
|
| 92 |
|
| 93 |
validate_certs (optional, bool, True) |
| 94 |
If \ :literal:`false`\ , the SSL certificates will not be validated. |
| 95 |
|
| 96 |
Configure \ :literal:`false`\ only on personally controlled sites where self-signed certificates are used. |
| 97 |
|
| 98 |
Prior to collection version \ :literal:`5.0.0`\ , the \ :emphasis:`validate\_certs`\ is \ :literal:`false`\ by default. |
| 99 |
|
| 100 |
|
| 101 |
ca_path (optional, path, None) |
| 102 |
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
| 103 |
|
| 104 |
|
| 105 |
timeout (optional, int, 30) |
| 106 |
The socket level timeout in seconds. |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
Notes |
| 113 |
----- |
| 114 |
|
| 115 |
.. note:: |
| 116 |
- Run this module from a system that has direct access to Dell OpenManage Enterprise. |
| 117 |
- This module supports \ :literal:`check\_mode`\ . |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
Examples |
| 123 |
-------- |
| 124 |
|
| 125 |
.. code-block:: yaml+jinja |
| 126 |
|
| 127 |
|
| 128 |
--- |
| 129 |
- name: Get all jobs details |
| 130 |
dellemc.openmanage.ome_job_info: |
| 131 |
hostname: "192.168.0.1" |
| 132 |
username: "username" |
| 133 |
password: "password" |
| 134 |
ca_path: "/path/to/ca_cert.pem" |
| 135 |
|
| 136 |
- name: Get job details for id |
| 137 |
dellemc.openmanage.ome_job_info: |
| 138 |
hostname: "192.168.0.1" |
| 139 |
username: "username" |
| 140 |
password: "password" |
| 141 |
ca_path: "/path/to/ca_cert.pem" |
| 142 |
job_id: 12345 |
| 143 |
|
| 144 |
- name: Get filtered job details |
| 145 |
dellemc.openmanage.ome_job_info: |
| 146 |
hostname: "192.168.0.1" |
| 147 |
username: "username" |
| 148 |
password: "password" |
| 149 |
ca_path: "/path/to/ca_cert.pem" |
| 150 |
system_query_options: |
| 151 |
top: 2 |
| 152 |
skip: 1 |
| 153 |
filter: "JobType/Id eq 8" |
| 154 |
|
| 155 |
- name: Get detail job execution history with last execution detail for a job. |
| 156 |
dellemc.openmanage.ome_job_info: |
| 157 |
hostname: "192.168.0.1" |
| 158 |
username: "username" |
| 159 |
password: "password" |
| 160 |
ca_path: "/path/to/ca_cert.pem" |
| 161 |
job_id: 12345 |
| 162 |
fetch_execution_history: true |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
Return Values |
| 167 |
------------- |
| 168 |
|
| 169 |
msg (always, str, Successfully fetched the job info) |
| 170 |
Overall status of the job facts operation. |
| 171 |
|
| 172 |
|
| 173 |
job_info (success, dict, {'value': [{'Id': 10429, 'JobName': 'Discovery-201', 'JobDescription': 'Discovery-201', 'NextRun': None, 'LastRun': '2023-06-07 09:33:07.161', 'StartTime': None, 'EndTime': None, 'Schedule': 'startnow', 'State': 'Enabled', 'CreatedBy': 'admin', 'UpdatedBy': 'admin', 'Visible': True, 'Editable': True, 'Builtin': False, 'UserGenerated': True, 'Targets': [], 'Params': [], 'LastRunStatus': {'Id': 2070, 'Name': 'Failed'}, 'JobType': {'Id': 101, 'Name': 'Discovery_Task', 'Internal': False}, 'JobStatus': {'Id': 2080, 'Name': 'New'}, 'ExecutionHistories': [{'Id': 1243224, 'JobName': 'Discovery-201', 'Progress': '100', 'StartTime': '2023-06-07 09:33:07.148', 'EndTime': '2023-06-07 09:33:08.403', 'LastUpdateTime': '2023-06-07 09:33:08.447185', 'ExecutedBy': 'admin', 'JobId': 10429, 'JobStatus': {'Id': 2070, 'Name': 'Failed'}, 'ExecutionHistoryDetails': [{'Id': 1288519, 'Progress': '100', 'StartTime': '2023-06-07 09:33:07.525', 'EndTime': '2023-06-07 09:33:08.189', 'ElapsedTime': '00:00:00', 'Key': '198.168.0.1', 'Value': 'Running\nDiscovery of target 198.168.0.1 started .\nDiscovery target resolved to IP 198.168.0.1 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors.', 'ExecutionHistoryId': 1243224, 'IdBaseEntity': 0, 'JobStatus': {'Id': 2070, 'Name': 'Failed'}}, {'Id': 1288518, 'Progress': '100', 'StartTime': '2023-06-07 09:33:07.521', 'EndTime': '2023-06-07 09:33:08.313', 'ElapsedTime': '00:00:00', 'Key': '198.168.0.2', 'Value': 'Running\nDiscovery of target 198.168.0.2 started. \nDiscovery target resolved to IP 198.168.0.2 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors.', 'ExecutionHistoryId': 1243224, 'IdBaseEntity': 0, 'JobStatus': {'Id': 2070, 'Name': 'Failed'}}]}, {'Id': 1243218, 'JobName': 'Discovery-201', 'Progress': '100', 'StartTime': '2023-06-07 09:30:55.064', 'EndTime': '2023-06-07 09:30:56.338', 'LastUpdateTime': '2023-06-07 09:30:56.365294', 'ExecutedBy': 'admin', 'JobId': 10429, 'JobStatus': {'Id': 2070, 'Name': 'Failed'}, 'ExecutionHistoryDetails': [{'Id': 1288512, 'Progress': '100', 'StartTime': '2023-06-07 09:30:55.441', 'EndTime': '2023-06-07 09:30:56.085', 'ElapsedTime': '00:00:00', 'Key': '198.168.0.1', 'Value': 'Running\nDiscovery of target 198.168.0.1 started. \nDiscovery target resolved to IP 198.168.0.1 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors.', 'ExecutionHistoryId': 1243218, 'IdBaseEntity': 0, 'JobStatus': {'Id': 2070, 'Name': 'Failed'}}, {'Id': 1288511, 'Progress': '100', 'StartTime': '2023-06-07 09:30:55.439', 'EndTime': '2023-06-07 09:30:56.21', 'ElapsedTime': '00:00:00', 'Key': '198.168.0.2', 'Value': 'Running\nDiscovery of target 198.168.0.2 started. \nDiscovery target resolved to IP 198.168.0.2 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation.\n=======================================\nTask Failed. Completed With Errors.', 'ExecutionHistoryId': 1243218, 'IdBaseEntity': 0, 'JobStatus': {'Id': 2070, 'Name': 'Failed'}}]}], 'LastExecutionDetail': {'Id': 1288519, 'Progress': '100', 'StartTime': '2023-06-07 09:33:07.525', 'EndTime': '2023-06-07 09:33:08.189', 'ElapsedTime': None, 'Key': '198.168.0.1', 'Value': 'Running\nDiscovery of target 198.168.0.1 started. \nDiscovery target resolved to IP 198.168.0.1 .\n: ========== EEMI Code: CGEN1009 ==========\nMessage: Unable to perform the requested action because the device management endpoint authentication over WSMAN, REDFISH failed. \nRecommended actions: Make sure the credentials associated with the device management endpoint are valid and retry the operation. \n=======================================\nTask Failed. Completed With Errors.', 'ExecutionHistoryId': 1243224, 'IdBaseEntity': 0, 'JobStatus': {'Id': 2070, 'Name': 'Failed'}}}]}) |
| 174 |
Details of the OpenManage Enterprise jobs. |
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
Status |
| 181 |
------ |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
Authors |
| 188 |
~~~~~~~ |
| 189 |
|
| 190 |
- Jagadeesh N V (@jagadeeshnv) |
| 191 |
- Abhishek Sinha (@Abhishek-Dell) |
| 192 |
- Mangirish Kenkare(@MangirishK) |
| 193 |
|