Skip to content

Commit fdcbf56

Browse files
authored
[Documentation][zos_job_query] Add docstrings to modules/zos_job_query.py (#1353)
* Add docstrings to modules/zos_job_query.py * Create changelog fragment * Modify google style to numpy * Standarize numpy style
1 parent 581fdb2 commit fdcbf56

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
trivial:
2+
- zos_job_query - Updated docstrings to numpy style for visual aid to developers.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/1353).

plugins/modules/zos_job_query.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,15 @@
266266

267267

268268
def run_module():
269-
269+
"""Initialize the module.
270+
271+
Raises
272+
------
273+
fail_json
274+
Parameter verification failed.
275+
fail_json
276+
Any exception while getting job params.
277+
"""
270278
module_args = dict(
271279
job_name=dict(type="str", required=False, default="*"),
272280
owner=dict(type="str", required=False),
@@ -313,7 +321,27 @@ def run_module():
313321

314322

315323
def query_jobs(job_name, job_id, owner):
316-
324+
"""Returns jobs that coincide with the given arguments.
325+
326+
Parameters
327+
----------
328+
job_name : str
329+
Name of the jobs.
330+
job_id : str
331+
Id of the jobs.
332+
owner : str
333+
Owner of the jobs.
334+
335+
Returns
336+
-------
337+
Union[str]
338+
List with the jobs.
339+
340+
Raises
341+
------
342+
RuntimeError
343+
No job with was found.
344+
"""
317345
jobs = []
318346
if job_id:
319347
jobs = job_status(job_id=job_id)
@@ -327,6 +355,18 @@ def query_jobs(job_name, job_id, owner):
327355

328356

329357
def parsing_jobs(jobs_raw):
358+
"""Parse job into an understandable format.
359+
360+
Parameters
361+
----------
362+
jobs_raw : dict
363+
Raw jobs.
364+
365+
Returns
366+
-------
367+
dict
368+
Parsed jobs.
369+
"""
330370
jobs = []
331371
ret_code = {}
332372
for job in jobs_raw:

0 commit comments

Comments
 (0)