Skip to content

Conversation

@surendrababuravella
Copy link
Collaborator

@surendrababuravella surendrababuravella commented Oct 21, 2025

SUMMARY

New module zos_started_task which support start, display, modify, cancel, stop and force operations.

ISSUE TYPE

New Module Pull Request

COMPONENT NAME

zos_started_task

ADDITIONAL INFORMATION

@surendrababuravella
Copy link
Collaborator Author

surendrababuravella commented Oct 21, 2025

Start command response when started task gets started successfully:

{
    "msg": {
        "changed": true,
        "cmd": "S testr,SECS=300",
        "failed": false,
        "rc": 0,
        "state": "started",
        "stderr": "",
        "stderr_lines": [
            ""
        ],
        "stdout": "EC01244A   2025294  01:54:06.00             ISF031I CONSOLE OMVS0000 ACTIVATED\n
        EC01244A   2025294  01:54:06.00            -S TESTR,SECS=300 \n
        EC01244A   2025294  01:54:06.00             ",
        "stdout_lines": [
            "EC01244A   2025294  01:54:06.00             ISF031I CONSOLE OMVS0000 ACTIVATED",
            "EC01244A   2025294  01:54:06.00            -S TESTR,SECS=300 ",
            "EC01244A   2025294  01:54:06.00             "
        ],
        "system_logs": "",
        "tasks": [
            {
                "asidx": "0058",
                "cpu_time": "00000.00.00.003",
                "elapsed_time": "00000.01.41.137",
                "started_time": "2025-10-21 08:54:05.978805+00:00",
                "task_id": "STC00200",
                "task_identifier": "TESTR",
                "task_name": "TESTR"
            }
        ],
        "verbose_output": "1                       J E S 2  J O B  L O G  --  S Y S T E M  S T L 1  --  N O D E  S T L 1            \n
        0 \n 
        01.54.05 STC00200 ---- TUESDAY,   21 OCT 2025 ----\n 
        01.54.05 STC00200  IEF695I START TESTR    WITH JOBNAME TESTR    IS ASSIGNED TO USER USRT001 , GROUP SYS1\n 
        01.54.05 STC00200  $HASP373 TESTR    STARTED\n
                1 //TESTR    JOB MSGLEVEL=1                                               STC00200\n
                2 //STARTING EXEC TESTR,SECS=300                                                  \n
                3 XXMYSLEEP  PROC SECS=10                                                         \n
                  XX* Run a USS command using BPXBATCH                                            \n
                4 XXSTEP1    EXEC PGM=BPXBATCH,                                                   \n
                   XX         PARM='SH sleep &SECS'                                                \n
                   IEFC653I SUBSTITUTION JCL - PGM=BPXBATCH,PARM='SH sleep 300'\n
                5 XXSTDOUT   DD SYSOUT=*                                                          \n
                6 XXSTDERR   DD SYSOUT=*                                                          \n 
                7 XX                                                                              \n
                   STMT NO. MESSAGE\n
           2 IEFC001I PROCEDURE TESTR WAS EXPANDED USING SYSTEM LIBRARY USER.PRIVATE.PROCLIB\n
            IEF695I START TESTR    WITH JOBNAME TESTR    IS ASSIGNED TO USER USRT001 , GROUP SYS1\n
             IEF043I Actions taken by SMFLIMxx parmlib policy for TESTR    STEP1   \n
             Step shared page limit set to 2147483647 by policy - SMFLIM00 0001\n IEFA111I TESTR IS USING THE FOLLOWING JOB RELATED SETTINGS:\n
           SWA=ABOVE,TIOT SIZE=32K,DSENQSHR=DISALLOW,GDGBIAS=JOB\n
 IEF236I ALLOC. FOR TESTR TESTR\n IEF237I JES2 ALLOCATED TO STDOUT\n
  IEF237I JES2 ALLOCATED TO STDERR"
    }
}

Copy link
Collaborator

@richp405 richp405 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is impressive! Please should check with Fernando about adding a changelog fragment.

Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request few minor changes

type: str
aliases:
- identifier
get_system_logs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this option's name to system_logs, we are trying to avoid the verb options for the new 2.0 version so is better to have the same guidelines applied here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

- When I(state) is started, this is the name which should be assigned to a started task
while starting it. If I(job_name) is not specified, then I(member_name) is used as job's name.
- When I(state) is C(displayed), C(modified), C(cancelled), C(stopped), or C(forced), I(job_name) is the
started task name.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add bit more detail in here

Suggested change
started task name.
started task name used to query the system.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

type: bool
cmd:
description:
- Command executed via opercmd.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Command executed via opercmd.
- Command executed via opercmd to achieve the desired state.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

sample: 00000.00.00.003
elapsed_time:
description:
- The processor time used by the address space, including the initiator. This time does not include SRB time.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is the same as cpu_time is that intended?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

verbose_output=task_output_logs
)
if msg:
result['msg'] = msg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PLease always return msg even is if empty, we are trying to return more consistent values in the collection overall.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing all comments, making changes after feedback sessions where we went back and forth multiple times, even reverting previously agreed behaviors.

Appreciate your effort and attention to detail during the whole development process.

@fernandofloresg fernandofloresg added the Do not Merge When a pull request should not be merged for issue noted reasons label Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do not Merge When a pull request should not be merged for issue noted reasons

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants