ansible-collections / ibm_zos_core

Red Hat Ansible Certified Content for IBM Z
78 stars 44 forks source link

[Enhancement] Allow a fast and flexible method for querying jobs on the spool #1606

Open roded opened 4 months ago

roded commented 4 months ago

Is there an existing issue for this?

Enhancement or feature description

We currently use zos_job_query to query the spool for running jobs or STCs:

- name: Get all jobs on spool ({{ job_name }})
  zos_job_query:
    job_name: "{{ job_name }}"
  register: jobs_on_spool

For this query the only interesting fields are the JOBID and the ASID (we use the ASID to differentiate STCs of which there could be multiple with the same JOBNAME). zos_job_query however, seems to slow down when the spool contains many jobs. I'm not sure if this is due to the way zos_job_query queries the spool or if related to it doing a lot of work behind the scenes to query and parse many different fields from the spool (which are not relevant for our case).

We'd like to have a way to query the existence of a JOB on the spool as quickly as possible while also being able to select some relevant fields (such as the ASID for the case of STCs).

See also: https://github.com/ansible-collections/ibm_zos_core/issues/1451#issuecomment-2157290476

Ansible module

zos_job_query

ddimatos commented 3 months ago

I am looking into this, I have been reviewing code and discussing this with ZOAU, you can expect it will be a few weeks before I have something more conclusive and possibly we may ask for some commands to be run on your system.

roded commented 2 months ago

Hi @ddimatos, wondering if there was any progress on this. Anything we can do to help?