|
12 | 12 | module: stop_region
|
13 | 13 | short_description: Stop a CICS region
|
14 | 14 | 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 |
18 | 20 | SDTRAN system initialization parameter. The task runs until the region has successfully shut down, or until the shutdown fails.
|
19 | 21 | - You must have a console installed in the CICS region so that the stop_region module can communicate with CICS. To define a console,
|
20 | 22 | you must install a terminal with the CONSNAME attribute set to your TSO user ID. For detailed instructions, see
|
21 | 23 | 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).
|
22 | 24 | Add your console definition into one of the resource lists defined on the GRPLIST system initialization parameter so that it gets
|
23 | 25 | installed into the CICS region.
|
24 | 26 | 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. |
25 | 29 | version_added: 1.1.0-beta.5
|
26 | 30 | author:
|
27 | 31 | - Kiera Bennett (@KieraBennett)
|
|
31 | 35 | - Identifies the job ID belonging to the running CICS region.
|
32 | 36 | - The stop_region module uses this job ID to identify the state of the CICS region and shut it down.
|
33 | 37 | 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 |
35 | 46 | mode:
|
36 | 47 | description:
|
37 | 48 | - Specify the type of shutdown to be executed on the CICS region.
|
|
54 | 65 | type: bool
|
55 | 66 | default: false
|
56 | 67 | 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 |
57 | 75 | '''
|
58 | 76 |
|
59 | 77 |
|
|
66 | 84 | ibm.ibm_zos_cics.stop_region:
|
67 | 85 | job_id: JOB12354
|
68 | 86 | 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 |
69 | 102 | '''
|
70 | 103 |
|
71 | 104 | RETURN = r'''
|
72 | 105 | changed:
|
73 |
| - description: True if the PERFORM SHUTDOWN command was executed. |
| 106 | + description: True if the PERFORM SHUTDOWN or CANCEL command was executed. |
74 | 107 | returned: always
|
75 | 108 | type: bool
|
76 | 109 | failed:
|
@@ -201,9 +234,10 @@ def main(self):
|
201 | 234 | self.result = self.get_result()
|
202 | 235 | self._module.exit_json(**self.result)
|
203 | 236 |
|
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)) |
207 | 241 |
|
208 | 242 | def _fail(self, msg): # type: (str) -> None
|
209 | 243 | self.failed = True
|
|
0 commit comments