Skip to content

Commit f456fbc

Browse files
committed
stop module doc update and generation
Signed-off-by: Andrew Twydell <[email protected]>
1 parent 6dcd0b4 commit f456fbc

File tree

2 files changed

+89
-12
lines changed

2 files changed

+89
-12
lines changed

docs/source/modules/stop_region.rst

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ stop_region -- Stop a CICS region
2020

2121
Synopsis
2222
--------
23-
- Stop a CICS region by using CEMT PERFORM SHUTDOWN. You can choose to perform a NORMAL or IMMEDIATE shutdown.
24-
- During a NORMAL or IMMEDIATE shutdown, a shutdown assist program should run to enable CICS to shut down in a controlled manner. By default, the CICS-supplied shutdown assist transaction, CESD is used. You can specify a custom shutdown assist program in the SDTRAN system initialization parameter. The task runs until the region has successfully shut down, or until the shutdown fails.
23+
- Stop a CICS region by issuing a CEMT PERFORM SHUTDOWN, or cancel the job using ZOAU's job cancelling capability.
24+
- The job\_id, job\_name, or both can be used to shutdown a region. If mulitple jobs are running with the same name, the job\_id is required.
25+
- You can choose the shutdown mode from NORMAL, IMMEDIATE, or CANCEL.
26+
- During a NORMAL or IMMEDIATE shutdown, a shutdown assist transaction should run to enable CICS to shut down in a controlled manner. By default, the CICS-supplied shutdown assist transaction, CESD is used. You can specify a custom shutdown assist transaction in the SDTRAN system initialization parameter. The task runs until the region has successfully shut down, or until the shutdown fails.
2527
- You must have a console installed in the CICS region so that the stop\_region module can communicate with CICS. To define a console, you must install a terminal with the CONSNAME attribute set to your TSO user ID. For detailed instructions, see \ `Defining TSO users as console devices <https://www.ibm.com/docs/en/cics-ts/6.1?topic=cics-defining-tso-users-as-console-devices>`__\ . Add your console definition into one of the resource lists defined on the GRPLIST system initialization parameter so that it gets installed into the CICS region. Alternatively, you can use a DFHCSDUP script to update an existing CSD. This function is provided by the csd module.
28+
- You may specify a timeout, in seconds, to wait for the region to stop after issuing the command. If this timeout is reached, the module completes in a failed state. Default behaviour does not use a timeout, which is set using a value of -1.
2629

2730

2831

@@ -39,7 +42,20 @@ job_id
3942
The stop\_region module uses this job ID to identify the state of the CICS region and shut it down.
4043

4144

42-
| **required**: True
45+
| **required**: False
46+
| **type**: str
47+
48+
49+
50+
job_name
51+
Identifies the job name belonging to the running CICS region.
52+
53+
The stop\_region module uses this job name to identify the state of the CICS region and shut it down.
54+
55+
The job\_name must be unique; if multiple jobs with the same name are running, use job\_id.
56+
57+
58+
| **required**: False
4359
| **type**: str
4460
4561

@@ -74,6 +90,18 @@ sdtran
7490
| **type**: str
7591
7692

93+
94+
timeout
95+
Time to wait for region to stop, in seconds.
96+
97+
Specify -1 to exclude a timeout.
98+
99+
100+
| **required**: False
101+
| **type**: int
102+
| **default**: -1
103+
104+
77105

78106

79107
Examples
@@ -91,6 +119,21 @@ Examples
91119
job_id: JOB12354
92120
mode: immediate
93121

122+
- name: "Stop CICS region with name and ID"
123+
ibm.ibm_zos_cics.stop_region:
124+
job_id: JOB12354
125+
job_name: MYREG01
126+
127+
- name: "Stop CICS using job name"
128+
ibm.ibm_zos_cics.stop_region:
129+
job_name: ANS1234
130+
mode: normal
131+
132+
- name: "Cancel CICS region"
133+
ibm.ibm_zos_cics.stop_region:
134+
job_name: ANS1234
135+
mode: cancel
136+
94137

95138

96139

@@ -106,7 +149,7 @@ Return Values
106149

107150

108151
changed
109-
| True if the PERFORM SHUTDOWN command was executed.
152+
| True if the PERFORM SHUTDOWN or CANCEL command was executed.
110153
111154
| **returned**: always
112155
| **type**: bool

plugins/modules/stop_region.py

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@
1212
module: stop_region
1313
short_description: Stop a CICS region
1414
description:
15-
- Stop a CICS region by using CEMT PERFORM SHUTDOWN. You can choose to perform a NORMAL or IMMEDIATE shutdown.
16-
- During a NORMAL or IMMEDIATE shutdown, a shutdown assist program should run to enable CICS to shut down in a controlled manner.
17-
By default, the CICS-supplied shutdown assist transaction, CESD is used. You can specify a custom shutdown assist program in the
15+
- Stop a CICS region by issuing a CEMT PERFORM SHUTDOWN, or cancel the job using ZOAU's job cancelling capability.
16+
- The job_id, job_name, or both can be used to shutdown a region. If mulitple jobs are running with the same name, the job_id is required.
17+
- You can choose the shutdown mode from NORMAL, IMMEDIATE, or CANCEL.
18+
- During a NORMAL or IMMEDIATE shutdown, a shutdown assist transaction should run to enable CICS to shut down in a controlled manner.
19+
By default, the CICS-supplied shutdown assist transaction, CESD is used. You can specify a custom shutdown assist transaction in the
1820
SDTRAN system initialization parameter. The task runs until the region has successfully shut down, or until the shutdown fails.
1921
- You must have a console installed in the CICS region so that the stop_region module can communicate with CICS. To define a console,
2022
you must install a terminal with the CONSNAME attribute set to your TSO user ID. For detailed instructions, see
2123
L(Defining TSO users as console devices,https://www.ibm.com/docs/en/cics-ts/6.1?topic=cics-defining-tso-users-as-console-devices).
2224
Add your console definition into one of the resource lists defined on the GRPLIST system initialization parameter so that it gets
2325
installed into the CICS region.
2426
Alternatively, you can use a DFHCSDUP script to update an existing CSD. This function is provided by the csd module.
27+
- You may specify a timeout, in seconds, to wait for the region to stop after issuing the command. If this timeout is reached, the module
28+
completes in a failed state. Default behaviour does not use a timeout, which is set using a value of -1.
2529
version_added: 1.1.0-beta.5
2630
author:
2731
- Kiera Bennett (@KieraBennett)
@@ -31,7 +35,14 @@
3135
- Identifies the job ID belonging to the running CICS region.
3236
- The stop_region module uses this job ID to identify the state of the CICS region and shut it down.
3337
type: str
34-
required: true
38+
required: false
39+
job_name:
40+
description:
41+
- Identifies the job name belonging to the running CICS region.
42+
- The stop_region module uses this job name to identify the state of the CICS region and shut it down.
43+
- The job_name must be unique; if multiple jobs with the same name are running, use job_id.
44+
type: str
45+
required: false
3546
mode:
3647
description:
3748
- Specify the type of shutdown to be executed on the CICS region.
@@ -54,6 +65,13 @@
5465
type: bool
5566
default: false
5667
required: false
68+
timeout:
69+
description:
70+
- Time to wait for region to stop, in seconds.
71+
- Specify -1 to exclude a timeout.
72+
type: int
73+
default: -1
74+
required: false
5775
'''
5876

5977

@@ -66,11 +84,26 @@
6684
ibm.ibm_zos_cics.stop_region:
6785
job_id: JOB12354
6886
mode: immediate
87+
88+
- name: "Stop CICS region with name and ID"
89+
ibm.ibm_zos_cics.stop_region:
90+
job_id: JOB12354
91+
job_name: MYREG01
92+
93+
- name: "Stop CICS using job name"
94+
ibm.ibm_zos_cics.stop_region:
95+
job_name: ANS1234
96+
mode: normal
97+
98+
- name: "Cancel CICS region"
99+
ibm.ibm_zos_cics.stop_region:
100+
job_name: ANS1234
101+
mode: cancel
69102
'''
70103

71104
RETURN = r'''
72105
changed:
73-
description: True if the PERFORM SHUTDOWN command was executed.
106+
description: True if the PERFORM SHUTDOWN or CANCEL command was executed.
74107
returned: always
75108
type: bool
76109
failed:
@@ -201,9 +234,10 @@ def main(self):
201234
self.result = self.get_result()
202235
self._module.exit_json(**self.result)
203236

204-
def _validate_sdtran(self, program): # type: (str) -> None
205-
if len(program) > 4:
206-
self._fail("Value: {0}, is invalid. SDTRAN value must be 1-4 characters.".format(program))
237+
def _validate_sdtran(self, transaction): # type: (str) -> None
238+
if len(transaction) > 4:
239+
self._fail(
240+
"Value: {0}, is invalid. SDTRAN value must be 1-4 characters.".format(transaction))
207241

208242
def _fail(self, msg): # type: (str) -> None
209243
self.failed = True

0 commit comments

Comments
 (0)