@broadcom/ops-for-zowe-cli 5.1.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +105 -74
- package/lib/api/Create.d.ts +14 -2
- package/lib/api/Create.js +13 -15
- package/lib/api/Create.js.map +1 -1
- package/lib/api/Execute.d.ts +13 -2
- package/lib/api/Execute.js +22 -110
- package/lib/api/Execute.js.map +1 -1
- package/lib/api/Show.d.ts +66 -8
- package/lib/api/Show.js +77 -75
- package/lib/api/Show.js.map +1 -1
- package/lib/api/Update.d.ts +2 -4
- package/lib/api/Update.js +4 -9
- package/lib/api/Update.js.map +1 -1
- package/lib/api/doc/IExecuteCommandCommandBody.d.ts +23 -0
- package/lib/api/doc/IExecuteCommandCommandBody.js +25 -0
- package/lib/api/doc/IExecuteCommandCommandBody.js.map +1 -0
- package/lib/api/doc/IShowRecordsCommandBody.d.ts +16 -0
- package/lib/api/doc/IShowRecordsCommandBody.js +25 -0
- package/lib/api/doc/IShowRecordsCommandBody.js.map +1 -0
- package/lib/api/doc/IShowRecordsResponse.d.ts +60 -0
- package/lib/api/doc/IShowRecordsResponse.js +25 -0
- package/lib/api/doc/IShowRecordsResponse.js.map +1 -0
- package/lib/api/doc/IShowTableResponse.d.ts +3 -0
- package/lib/api/doc/IShowTableResponse.js +25 -0
- package/lib/api/doc/IShowTableResponse.js.map +1 -0
- package/lib/api/doc/index.d.ts +1 -0
- package/lib/api/doc/index.js +1 -0
- package/lib/api/doc/index.js.map +1 -1
- package/lib/api/utils/CommandListUtils.js +8 -3
- package/lib/api/utils/CommandListUtils.js.map +1 -1
- package/lib/api/utils/LognameListUtils.js +0 -1
- package/lib/api/utils/LognameListUtils.js.map +1 -1
- package/lib/api/utils/OpsRestClient.js +0 -2
- package/lib/api/utils/OpsRestClient.js.map +1 -1
- package/lib/api/utils/OpsTextUtils.js +0 -1
- package/lib/api/utils/OpsTextUtils.js.map +1 -1
- package/lib/api/utils/RecordsListUtils.d.ts +53 -0
- package/lib/api/utils/RecordsListUtils.js +146 -0
- package/lib/api/utils/RecordsListUtils.js.map +1 -0
- package/lib/api/utils/RecordsUtils.d.ts +5 -0
- package/lib/api/utils/RecordsUtils.js +45 -0
- package/lib/api/utils/RecordsUtils.js.map +1 -0
- package/lib/api/utils/RexxListUtils.js +7 -6
- package/lib/api/utils/RexxListUtils.js.map +1 -1
- package/lib/api/utils/RuleUtils.js +2 -2
- package/lib/api/utils/RuleUtils.js.map +1 -1
- package/lib/api/utils/RulesetListUtils.js +0 -1
- package/lib/api/utils/RulesetListUtils.js.map +1 -1
- package/lib/api/utils/RulesetUtils.d.ts +1 -1
- package/lib/api/utils/RulesetUtils.js +1 -1
- package/lib/api/utils/RulesetUtils.js.map +1 -1
- package/lib/api/utils/SubsystemListUtils.js +0 -1
- package/lib/api/utils/SubsystemListUtils.js.map +1 -1
- package/lib/api/utils/TableUtils.d.ts +4 -1
- package/lib/api/utils/TableUtils.js +7 -7
- package/lib/api/utils/TableUtils.js.map +1 -1
- package/lib/api/utils/index.d.ts +3 -0
- package/lib/api/utils/index.js +3 -0
- package/lib/api/utils/index.js.map +1 -1
- package/lib/cli/OpsBaseHandler.js +0 -2
- package/lib/cli/OpsBaseHandler.js.map +1 -1
- package/lib/cli/RecordsParameterDefinitions.d.ts +18 -0
- package/lib/cli/RecordsParameterDefinitions.js +157 -0
- package/lib/cli/RecordsParameterDefinitions.js.map +1 -0
- package/lib/cli/create/event/Event.handler.js +12 -2
- package/lib/cli/create/event/Event.handler.js.map +1 -1
- package/lib/cli/execute/command/Command.handler.js +50 -5
- package/lib/cli/execute/command/Command.handler.js.map +1 -1
- package/lib/cli/show/Show.definition.js +4 -3
- package/lib/cli/show/Show.definition.js.map +1 -1
- package/lib/cli/show/logname/Logname.handler.js +4 -2
- package/lib/cli/show/logname/Logname.handler.js.map +1 -1
- package/lib/cli/show/parms/Parms.handler.js +4 -3
- package/lib/cli/show/parms/Parms.handler.js.map +1 -1
- package/lib/cli/show/records/Records.definition.d.ts +17 -0
- package/lib/cli/show/records/Records.definition.js +82 -0
- package/lib/cli/show/records/Records.definition.js.map +1 -0
- package/lib/cli/show/records/Records.handler.d.ts +5 -0
- package/lib/cli/show/records/Records.handler.js +67 -0
- package/lib/cli/show/records/Records.handler.js.map +1 -0
- package/lib/cli/show/ruleset/Ruleset.handler.js +8 -2
- package/lib/cli/show/ruleset/Ruleset.handler.js.map +1 -1
- package/lib/cli/show/status/Status.handler.js +4 -2
- package/lib/cli/show/status/Status.handler.js.map +1 -1
- package/lib/cli/show/subsystem/Subsystem.handler.js +4 -2
- package/lib/cli/show/subsystem/Subsystem.handler.js.map +1 -1
- package/lib/cli/show/table/Table.handler.js +8 -2
- package/lib/cli/show/table/Table.handler.js.map +1 -1
- package/lib/healthCheck.handler.js +0 -1
- package/lib/healthCheck.handler.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
- package/imgs/zowe-conformant-v1.png +0 -0
- package/imgs/zowe-conformant-zowev2-cli-color.png +0 -0
- package/imgs/zowe-conformant-zowev3-cli-color.png +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ Using the plug-in, you can benefit from the following OPS/MVS features:
|
|
|
13
13
|
- *Display the subsystems.
|
|
14
14
|
- *Display RDF tables.
|
|
15
15
|
- *Display SSM parms.
|
|
16
|
+
- *Display OPSLOG records.
|
|
16
17
|
- *Execute a REXX program.
|
|
17
18
|
- *Execute a operator command.
|
|
18
19
|
- *Create a generic AOF event for API rules processing.
|
|
@@ -20,13 +21,13 @@ Using the plug-in, you can benefit from the following OPS/MVS features:
|
|
|
20
21
|
Note: * Indicates only available if you are using the plug-in with the OPS/MVS REST API.
|
|
21
22
|
|
|
22
23
|
## Prerequisites
|
|
23
|
-
- Install
|
|
24
|
+
- Install [Zowe CLI](https://docs.zowe.org/stable/user-guide/cli-installcli/) on your computer.
|
|
24
25
|
|
|
25
|
-
<img src="
|
|
26
|
+
<img src="https://artwork.openmainframeproject.org/other/zowe-conformant/zowev3/cli/color/zowe-conformant-zowev3-cli-color.svg" width=25% alt="Zowe v2 CLI Conformance Badge">
|
|
26
27
|
|
|
27
28
|
- Install one of the following OPS/MVS components:
|
|
28
|
-
-
|
|
29
|
-
-
|
|
29
|
+
- [The REST API](https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-ops-mvs-event-management-and-automation/14-0/using/use-the-rest-api.html)
|
|
30
|
+
- [RESTful Web Services](https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-ops-mvs-event-management-and-automation/14-0/administrating/restful-web-services/deploy-and-configure-ca-ops-mvs-restful-web-services.html)
|
|
30
31
|
|
|
31
32
|
To use the plug-in with multiple OPS/MVS instances running on different systems, install and configure the RESTful Web Services component or the REST API to one OPS/MVS instance on each system. When you have multiple instances of OPS/MVS running on a single system, only one instance of the RESTful Web Services component or the REST API is required.
|
|
32
33
|
|
|
@@ -34,7 +35,7 @@ To use the plug-in with multiple OPS/MVS instances running on different systems,
|
|
|
34
35
|
|
|
35
36
|
### Security Requirements
|
|
36
37
|
To issue OPS/MVS commands through the plug-in, you must be authorized for those commands through OPS/MVS
|
|
37
|
-
security. For more information, refer to the article
|
|
38
|
+
security. For more information, refer to the article [Authorize REST API Users](https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-ops-mvs-event-management-and-automation/14-0/securing/authorize-rest-api-users.html).
|
|
38
39
|
|
|
39
40
|
## Install the OPS/MVS Plug-in From a Local Package
|
|
40
41
|
To install the OPS/MVS plug-in to the Zowe CLI from a local package:
|
|
@@ -58,6 +59,12 @@ When the validation process is successful, the following message displays:
|
|
|
58
59
|
If the validation process fails, a failure message displays.
|
|
59
60
|
You can troubleshoot the installation by addressing the issues that the message describes. You can also review the information contained in the log file that is located in the Zowe CLI home directory.
|
|
60
61
|
|
|
62
|
+
## Uninstall the OPS/MVS Plug-in From Zowe CLI
|
|
63
|
+
To uninstall the plug-in from Zowe CLI, issue the following command:
|
|
64
|
+
```sh
|
|
65
|
+
zowe plugins uninstall @broadcom/ops-for-zowe-cli
|
|
66
|
+
```
|
|
67
|
+
|
|
61
68
|
## Create an OPS/MVS Profile
|
|
62
69
|
You can set up an OPS/MVS profile to avoid typing your connection details on every command.
|
|
63
70
|
1. Gather the following data:
|
|
@@ -85,9 +92,24 @@ You can set up an OPS/MVS profile to avoid typing your connection details on eve
|
|
|
85
92
|
zowe config set profiles.ops.properties.rest-api true or false --gc
|
|
86
93
|
```
|
|
87
94
|
|
|
88
|
-
The following
|
|
95
|
+
The following example shows an OPS/MVS profile inside a global configuration file:
|
|
89
96
|
|
|
90
|
-
|
|
97
|
+
```
|
|
98
|
+
"profiles": {
|
|
99
|
+
"ops": {
|
|
100
|
+
"type": "ops",
|
|
101
|
+
"properties": {
|
|
102
|
+
"host": "example.net",
|
|
103
|
+
"port": 12345,
|
|
104
|
+
"protocol": "https",
|
|
105
|
+
"subsystem": "SYS1",
|
|
106
|
+
"rest-api": false,
|
|
107
|
+
"reject-unauthorized": false
|
|
108
|
+
},
|
|
109
|
+
"secure": []
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
91
113
|
|
|
92
114
|
|
|
93
115
|
## Create an OPS/MVS Profile for the Zowe API ML</a>
|
|
@@ -103,13 +125,29 @@ To create an OPS/MVS plug-in profile for the Zowe API ML:
|
|
|
103
125
|
|
|
104
126
|
2. Follow the directions in step 2 of [Create an OPS/MVS Profile](#create-an-opsmvs-profile), including the additional data you gathered in step 1 of this section.
|
|
105
127
|
|
|
106
|
-
The following
|
|
128
|
+
The following example shows an OPS/MVS profile for the Zowe API ML inside a global configuration file:
|
|
107
129
|
|
|
108
|
-
|
|
130
|
+
```
|
|
131
|
+
"opsapiml": {
|
|
132
|
+
"type": "ops",
|
|
133
|
+
"properties": {
|
|
134
|
+
"host": "example.net",
|
|
135
|
+
"port": 12345,
|
|
136
|
+
"user": "user1",
|
|
137
|
+
"password": "password",
|
|
138
|
+
"protocol": "https",
|
|
139
|
+
"subsystem": "SYS1",
|
|
140
|
+
"rest-api": true,
|
|
141
|
+
"reject-unauthorized": false,
|
|
142
|
+
"base-path": "opsrestapi/api/v1"
|
|
143
|
+
},
|
|
144
|
+
"secure": []
|
|
145
|
+
}
|
|
146
|
+
```
|
|
109
147
|
|
|
110
148
|
## Using the OPS/MVS Plug-in for Zowe CLI
|
|
111
149
|
|
|
112
|
-
For details about the commands, actions, and options in this plug-in, refer to the Zowe CLI Help.
|
|
150
|
+
For details about the commands, actions, and options in this plug-in, refer to the Zowe CLI Help.
|
|
113
151
|
|
|
114
152
|
When Zowe CLI is installed, you can display Zowe CLI Help for the OPS/MVS plug-in by doing _one_ of the following from a command line:
|
|
115
153
|
|
|
@@ -125,90 +163,83 @@ When you enter a command using the OPS/MVS Plug-in for Zowe CLI, you will receiv
|
|
|
125
163
|
|
|
126
164
|
1 - Execution failed
|
|
127
165
|
|
|
128
|
-
##
|
|
129
|
-
|
|
166
|
+
## Available Commands
|
|
167
|
+
**Note:** an asterisk (*) beside the command name indicates that it is only available if you are using the plug-in with the OPS/MVS REST API. To use these commands, you must either have the parameter `"rest-api": true,` included in your Zowe team config ops profile, or include the parameter `--rest-api true` as part of the command line request.
|
|
130
168
|
|
|
131
|
-
|
|
169
|
+
### create
|
|
132
170
|
|
|
133
|
-
|
|
134
|
-
The commands `start resource` and `stop resource` have the following positional arguments.
|
|
135
|
-
In a breaking change, `tablename` is now a required positional argument.
|
|
171
|
+
- **create event***
|
|
136
172
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
The name of the resource.
|
|
173
|
+
- Use the `create event` command to create a generic AOF event for API rules processing.
|
|
140
174
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
The name of the table that contains the resource.
|
|
144
|
-
|
|
175
|
+
### disable
|
|
145
176
|
|
|
146
|
-
|
|
177
|
+
- **disable rule**
|
|
147
178
|
|
|
148
|
-
|
|
179
|
+
- Use the `disable rule` command to disable the specified rule.
|
|
149
180
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
Use the new `show ruleset` command to display the status of a specific automation rule set.
|
|
181
|
+
### enable
|
|
153
182
|
|
|
154
|
-
**
|
|
183
|
+
- **enable rule**
|
|
155
184
|
|
|
156
|
-
Use the
|
|
185
|
+
- Use the `enable rule` command to enable the specified rule.
|
|
157
186
|
|
|
158
|
-
|
|
187
|
+
### execute
|
|
159
188
|
|
|
160
|
-
|
|
189
|
+
- **execute command***
|
|
161
190
|
|
|
162
|
-
|
|
191
|
+
- Use the `execute command` command to execute the specified operator command.
|
|
163
192
|
|
|
164
|
-
|
|
193
|
+
- **execute rexx***
|
|
165
194
|
|
|
166
|
-
|
|
195
|
+
- Use the `execute rexx` command to execute the specified OPS/MVS REXX program.
|
|
167
196
|
|
|
168
|
-
|
|
197
|
+
### show
|
|
169
198
|
|
|
170
|
-
**
|
|
171
|
-
The work-around is to specify two single quotes. Example: "''fully.qualified.dataset(member)''"
|
|
199
|
+
- **show logname***
|
|
172
200
|
|
|
173
|
-
|
|
201
|
+
- Use the `show logname` command to display the logs defined to a subsystem.
|
|
174
202
|
|
|
175
|
-
|
|
203
|
+
- **show parms***
|
|
176
204
|
|
|
177
|
-
Use the
|
|
205
|
+
- Use the `show parms` command to display all the SSM parameters defined to a subsystem.
|
|
178
206
|
|
|
179
|
-
|
|
207
|
+
- **show records***
|
|
180
208
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
**show resource**
|
|
184
|
-
|
|
185
|
-
Use the `show resource` command to show the current and desired state of all resources
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
```
|
|
194
|
-
zowe ops show resource * --subsystem OPSS
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**show rule**
|
|
209
|
+
- Use the `show records` command to display a list of the OPSLOG records with attributes that are defined in the search query from the specified OPSLOG.
|
|
210
|
+
|
|
211
|
+
- **show resource**
|
|
212
|
+
|
|
213
|
+
- Use the `show resource` command to show the current and desired state of all resources associated with the specified SSM resource.
|
|
214
|
+
|
|
215
|
+
- **show rule**
|
|
216
|
+
|
|
217
|
+
- Use the `show rule` command with to display data associated with the specified rule.
|
|
218
|
+
|
|
219
|
+
- **show ruleset***
|
|
198
220
|
|
|
199
|
-
Use the `show
|
|
200
|
-
|
|
201
|
-
```
|
|
202
|
-
zowe ops show rule OPSRULES * --subsystem OPSS
|
|
203
|
-
```
|
|
204
|
-
Use the `show rule` command with the syntax shown in the following example to display the status of all rules in all rule sets for the OPSS subsystem:
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
zowe ops show rule * * --subsystem OPSS
|
|
208
|
-
```
|
|
221
|
+
- Use the `show ruleset` command to display the status of a specific automation rule set.
|
|
209
222
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
223
|
+
- **show status***
|
|
224
|
+
|
|
225
|
+
- Use the `show status` command to display the status of the REST API server.
|
|
226
|
+
|
|
227
|
+
- **show subsystem***
|
|
228
|
+
|
|
229
|
+
- Use the `show subsystem` command to display the subsystems running on an OPS system.
|
|
230
|
+
|
|
231
|
+
- **show table***
|
|
232
|
+
|
|
233
|
+
- Use the `show table` command to display data associated with RDF tables.
|
|
234
|
+
|
|
235
|
+
### start
|
|
236
|
+
|
|
237
|
+
- **start resource**
|
|
238
|
+
|
|
239
|
+
- Use the `start resource` command to start the specified resource.
|
|
240
|
+
|
|
241
|
+
### stop
|
|
242
|
+
|
|
243
|
+
- **stop resource**
|
|
244
|
+
|
|
245
|
+
- Use the `stop resource` command to stop the specified resource.
|
package/lib/api/Create.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Session } from "@zowe/imperative";
|
|
2
|
+
/**
|
|
3
|
+
* creates OPS/MVS Event
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @param {Session} session
|
|
7
|
+
* @param {{ eventCode?: any, eventText?: any, subSystem?: any }} body
|
|
8
|
+
* @return {*} {Promise<object>}
|
|
9
|
+
*/
|
|
10
|
+
export declare function createEvent(session: Session, body: {
|
|
11
|
+
eventCode?: any;
|
|
12
|
+
eventText?: any;
|
|
13
|
+
subSystem?: any;
|
|
14
|
+
}): Promise<object>;
|
package/lib/api/Create.js
CHANGED
|
@@ -35,24 +35,22 @@ exports.createEvent = void 0;
|
|
|
35
35
|
const utils_1 = require("./utils");
|
|
36
36
|
const constants_1 = require("./constants");
|
|
37
37
|
const OpsRestClient_1 = require("./utils/OpsRestClient");
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* creates OPS/MVS Event
|
|
40
|
+
*
|
|
41
|
+
* @export
|
|
42
|
+
* @param {Session} session
|
|
43
|
+
* @param {{ eventCode?: any, eventText?: any, subSystem?: any }} body
|
|
44
|
+
* @return {*} {Promise<object>}
|
|
45
|
+
*/
|
|
46
|
+
function createEvent(session, body) {
|
|
39
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const createEventUrl = utils_1.EventUtils.getCreateEventURL(session, subSystem);
|
|
48
|
+
const createEventUrl = utils_1.EventUtils.getCreateEventURL(session, body.subSystem);
|
|
41
49
|
const commandBody = {
|
|
42
|
-
eventCode: eventCode,
|
|
43
|
-
eventText: eventText
|
|
50
|
+
eventCode: body.eventCode,
|
|
51
|
+
eventText: body.eventText
|
|
44
52
|
};
|
|
45
|
-
|
|
46
|
-
return OpsRestClient_1.OpsRestClient.postExpectJSON(session, createEventUrl, constants_1.OpsConstants.headers, commandBody);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
/* istanbul ignore next */
|
|
50
|
-
// Display message indicating 'execute rexx' not supported with web services
|
|
51
|
-
params.response.console.log("Command 'create event' is only supported with the OPS/MVS REST API server");
|
|
52
|
-
}
|
|
53
|
-
/* istanbul ignore next */
|
|
54
|
-
return null;
|
|
55
|
-
// avoid code smell
|
|
53
|
+
return OpsRestClient_1.OpsRestClient.postExpectJSON(session, createEventUrl, constants_1.OpsConstants.headers, commandBody);
|
|
56
54
|
});
|
|
57
55
|
}
|
|
58
56
|
exports.createEvent = createEvent;
|
package/lib/api/Create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../src/api/Create.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAGH,mCAAqC;AACrC,2CAA2C;AAC3C,yDAAsD;
|
|
1
|
+
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../src/api/Create.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAGH,mCAAqC;AACrC,2CAA2C;AAC3C,yDAAsD;AAGtD;;;;;;;GAOG;AACH,SAAsB,WAAW,CAAC,OAAgB,EAAE,IAA2D;;QAC3G,MAAM,cAAc,GAAG,kBAAU,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAK7E,MAAM,WAAW,GAA4B;YACzC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC5B,CAAC;QACF,OAAO,6BAAa,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,wBAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACpG,CAAC;CAAA;AAXD,kCAWC"}
|
package/lib/api/Execute.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Session } from "@zowe/imperative";
|
|
2
2
|
import { IExecuteRexxResponse } from "./doc/IExecuteRexxResponse";
|
|
3
3
|
import { IExecuteCommandResponse } from "./doc/IExecuteCommandResponse";
|
|
4
4
|
import { IExecuteRexxCommandBody } from "./doc/IExecuteRexxCommandBody";
|
|
5
|
+
import { IExecuteCommandCommandBody } from "./doc/IExecuteCommandCommandBody";
|
|
5
6
|
/**
|
|
6
7
|
* formats and executes request to run opsrexx program
|
|
7
8
|
*
|
|
@@ -33,4 +34,14 @@ export declare function processWait(session: Session, program: string, instanceT
|
|
|
33
34
|
* @return {*} {Promise<IExecuteRexxResponse>}
|
|
34
35
|
*/
|
|
35
36
|
export declare function retrieveRexx(session: Session, instanceToken: string): Promise<IExecuteRexxResponse>;
|
|
36
|
-
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*
|
|
40
|
+
* @export
|
|
41
|
+
* @param {Session} session
|
|
42
|
+
* @param {IExecuteCommandCommandBody} body
|
|
43
|
+
* @param {string} subSystem
|
|
44
|
+
* @param {number} wait
|
|
45
|
+
* @return {*} {Promise<IExecuteCommandResponse>}
|
|
46
|
+
*/
|
|
47
|
+
export declare function executeCommand(session: Session, body: IExecuteCommandCommandBody, subSystem?: string, wait?: string): Promise<IExecuteCommandResponse>;
|
package/lib/api/Execute.js
CHANGED
|
@@ -112,118 +112,30 @@ function retrieveRexx(session, instanceToken) {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
exports.retrieveRexx = retrieveRexx;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* @export
|
|
119
|
+
* @param {Session} session
|
|
120
|
+
* @param {IExecuteCommandCommandBody} body
|
|
121
|
+
* @param {string} subSystem
|
|
122
|
+
* @param {number} wait
|
|
123
|
+
* @return {*} {Promise<IExecuteCommandResponse>}
|
|
124
|
+
*/
|
|
125
|
+
function executeCommand(session, body, subSystem, wait) {
|
|
118
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
-
if (!restApi) {
|
|
120
|
-
// Display message indicating 'execute command' not supported with web services
|
|
121
|
-
params.response.console.log("Command 'execute command' is only supported with the OPS/MVS REST API server");
|
|
122
|
-
/* istanbul ignore next */
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
if (wait != null) {
|
|
126
|
-
imperative_1.ImperativeExpect.toBeEqual(Number(wait) > 0 && Number(wait) <= CommandParameterDefinitions_1.CommandParameterDefinitions.WAIT_TIME, true, `Wait value must be between 1 and ${RexxParameterDefinitions_1.RexxParameterDefinitions.WAIT_TIME} (inclusive), if specified. You specified: ${wait}`);
|
|
127
|
-
}
|
|
128
|
-
// Validation
|
|
129
|
-
// 1. mutually exclusive - cmdWait and wait
|
|
130
|
-
// $ zowe ops execute command "D T" --ops-p "ops11restapi" --cmdWait "30" --wait "30"
|
|
131
|
-
// Parameters 'cmdWait' and 'wait' are mutually exclusive.
|
|
132
|
-
// 2. mutually exclusive - conName and conType
|
|
133
|
-
// $ zowe ops execute command "D T" --ops-p "ops11restapi" --output "NO" --wait "30"
|
|
134
|
-
// Parameters 'cmdWait' and 'wait' are mutually exclusive.
|
|
135
|
-
// 3. mutually exclusive - output = No and wait
|
|
136
|
-
// $ zowe ops execute command "D T" --ops-p "ops11restapi" --conType "NO" --conName "30"
|
|
137
|
-
// Parameters 'conType' and 'conName' are mutually exclusive.
|
|
138
|
-
// 4. mutually exclusive - stopMsg and stopResp
|
|
139
|
-
// $ zowe ops execute command "D T" --ops-p "ops11restapi" --stopMsg "NO" --stopResp "30"
|
|
140
|
-
// Parameters 'stopMsg' and 'stopResp' are mutually exclusive.
|
|
141
|
-
if ((cmdWait !== "" && cmdWait !== undefined) && (wait !== "" && wait !== undefined)) {
|
|
142
|
-
params.response.console.log("Parameters 'cmdWait' and 'wait' are mutually exclusive.");
|
|
143
|
-
/* istanbul ignore next */
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
if ((output === "NO") && (wait !== "" && wait !== undefined)) {
|
|
147
|
-
params.response.console.log(`Parameters 'output = "NO"' and 'wait' = ${wait} are mutually exclusive.`);
|
|
148
|
-
/* istanbul ignore next */
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
if ((conType !== "" && conType !== undefined) && (conName !== "" && conName !== undefined)) {
|
|
152
|
-
params.response.console.log("Parameters 'conType' and 'conName' are mutually exclusive.");
|
|
153
|
-
/* istanbul ignore next */
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
if ((stopMsg !== "" && stopMsg !== undefined) && (stopResp !== "" && stopResp !== undefined)) {
|
|
157
|
-
params.response.console.log("Parameters 'stopMsg' and 'stopResp' are mutually exclusive.");
|
|
158
|
-
/* istanbul ignore next */
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
127
|
const executeCommandUrl = utils_1.CommandUtils.getExecuteCommandURL(session, subSystem);
|
|
162
|
-
const commandBody = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
if (cmdEcho !== "" && cmdEcho !== undefined) {
|
|
175
|
-
commandBody.cmdEcho = cmdEcho;
|
|
176
|
-
}
|
|
177
|
-
if (cmdLog !== "" && cmdLog !== undefined) {
|
|
178
|
-
commandBody.cmdLog = cmdLog;
|
|
179
|
-
}
|
|
180
|
-
if (cmdWait !== "" && cmdWait !== undefined) {
|
|
181
|
-
commandBody.cmdWait = cmdWait;
|
|
182
|
-
}
|
|
183
|
-
if (conName !== "" && conName !== undefined) {
|
|
184
|
-
commandBody.conName = conName;
|
|
185
|
-
}
|
|
186
|
-
if (conType !== "" && conType !== undefined) {
|
|
187
|
-
commandBody.conType = conType;
|
|
188
|
-
}
|
|
189
|
-
if (imsId !== "" && imsId !== undefined) {
|
|
190
|
-
commandBody.imsId = imsId;
|
|
191
|
-
}
|
|
192
|
-
if (imsPlex !== "" && imsPlex !== undefined) {
|
|
193
|
-
commandBody.imsPlex = imsPlex;
|
|
194
|
-
}
|
|
195
|
-
if (imsReply !== "" && imsReply !== undefined) {
|
|
196
|
-
commandBody.imsReply = imsReply;
|
|
197
|
-
}
|
|
198
|
-
if (interval !== "" && interval !== undefined) {
|
|
199
|
-
commandBody.interval = interval;
|
|
200
|
-
}
|
|
201
|
-
if (localOnly !== "" && localOnly !== undefined) {
|
|
202
|
-
commandBody.localOnly = localOnly;
|
|
203
|
-
}
|
|
204
|
-
if (log !== "" && log !== undefined) {
|
|
205
|
-
commandBody.log = log;
|
|
206
|
-
}
|
|
207
|
-
if (maxCmdOut !== "" && maxCmdOut !== undefined) {
|
|
208
|
-
commandBody.maxCmdOut = maxCmdOut;
|
|
209
|
-
}
|
|
210
|
-
if (output !== "" && output !== undefined) {
|
|
211
|
-
commandBody.output = output;
|
|
212
|
-
}
|
|
213
|
-
if (stopEnd !== "" && stopEnd !== undefined) {
|
|
214
|
-
commandBody.stopEnd = stopEnd;
|
|
215
|
-
}
|
|
216
|
-
if (stopMsg !== "" && stopMsg !== undefined) {
|
|
217
|
-
commandBody.stopMsg = stopMsg;
|
|
218
|
-
}
|
|
219
|
-
if (stopResp !== "" && stopResp !== undefined) {
|
|
220
|
-
commandBody.stopResp = stopResp;
|
|
221
|
-
}
|
|
222
|
-
if (wait !== "" && wait !== undefined) {
|
|
223
|
-
commandBody.wait = wait;
|
|
224
|
-
}
|
|
225
|
-
if (debug !== "" && debug !== undefined) {
|
|
226
|
-
commandBody.debug = debug;
|
|
128
|
+
const commandBody = {};
|
|
129
|
+
const propertiesToCopy = ["command", "bmpCmdOut", "capture", "cart", "cmdEcho", "cmdLog", "cmdWait",
|
|
130
|
+
"conName", "conType", "imsId", "imsPlex", "imsReply", "interval", "localOnly", "log", "maxCmdOut", "output", "stopEnd", "stopMsg",
|
|
131
|
+
"stopResp", "debug"];
|
|
132
|
+
propertiesToCopy.forEach(property => {
|
|
133
|
+
if (body[property] !== undefined) {
|
|
134
|
+
commandBody[property] = body[property];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
if (wait) {
|
|
138
|
+
imperative_1.ImperativeExpect.toBeEqual(Number(wait) > 0 && Number(wait) <= CommandParameterDefinitions_1.CommandParameterDefinitions.WAIT_TIME, true, `Wait value must be between 1 and ${RexxParameterDefinitions_1.RexxParameterDefinitions.WAIT_TIME} (inclusive), if specified. You specified: ${wait}`);
|
|
227
139
|
}
|
|
228
140
|
return OpsRestClient_1.OpsRestClient.postExpectJSON(session, executeCommandUrl, constants_1.OpsConstants.headers, commandBody);
|
|
229
141
|
});
|
package/lib/api/Execute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Execute.js","sourceRoot":"","sources":["../../src/api/Execute.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"Execute.js","sourceRoot":"","sources":["../../src/api/Execute.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAEH,iDAA8E;AAC9E,mCAAkD;AAClD,2CAA2C;AAG3C,yDAAsD;AACtD,8EAA2E;AAC3E,oFAAiF;AAKjF;;;;;;;;;GASG;AACH,SAAsB,WAAW,CAAC,OAAgB,EAAE,IAA6B,EAAE,SAAiB,EAAE,IAAY;;QAC9G,MAAM,cAAc,GAAG,iBAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACvE,MAAM,WAAW,GAA4B,EAAE,CAAC;QAChD,MAAM,gBAAgB,GAAsC,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QAE3I,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAClC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;gBAChC,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;aACxC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAy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C,CAAC;SACnI;QACD,OAAO,6BAAa,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,EAAE,wBAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACvG,CAAC;CAAA;AAnBD,wCAmBC"}
|
package/lib/api/Show.d.ts
CHANGED
|
@@ -1,10 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IShowLognameResponse, IShowResourceResponse, IShowRuleResponse, IShowRulesetResponse, IShowStatusResponse, IShowSubsystemResponse } from ".";
|
|
1
|
+
import { Session } from "@zowe/imperative";
|
|
2
|
+
import { IShowLognameResponse, IShowResourceResponse, IShowRuleResponse, IShowRulesetResponse, IShowStatusResponse, IShowSubsystemResponse, IShowRecordsResponse } from ".";
|
|
3
|
+
import { IShowTableResponse } from "./doc/IShowTableResponse";
|
|
4
|
+
import { IShowRecordsCommandBody } from "./doc/IShowRecordsCommandBody";
|
|
3
5
|
export declare function showRule(session: Session, ruleSetName: string, ruleName: string, restApi: boolean, subSystem: string): Promise<IShowRuleResponse>;
|
|
4
6
|
export declare function showResource(session: Session, resourceName: string, restApi: boolean, table: string, subsystem: string): Promise<IShowResourceResponse>;
|
|
5
|
-
export declare function showRuleset(session: Session,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export declare function showRuleset(session: Session, body: {
|
|
8
|
+
ruleSetName: string;
|
|
9
|
+
subSystem: string;
|
|
10
|
+
}): Promise<IShowRulesetResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* returns system status
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @param {Session} session
|
|
16
|
+
* @return {*} {Promise<IShowStatusResponse>}
|
|
17
|
+
*/
|
|
18
|
+
export declare function showStatus(session: Session): Promise<IShowStatusResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* returns list of opslog names
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @param {Session} session
|
|
24
|
+
* @param {string} subSystem
|
|
25
|
+
* @return {*} {Promise<IShowLognameResponse>}
|
|
26
|
+
*/
|
|
27
|
+
export declare function showLogname(session: Session, subSystem: string): Promise<IShowLognameResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* returns list of subsytems
|
|
30
|
+
*
|
|
31
|
+
* @export
|
|
32
|
+
* @param {Session} session
|
|
33
|
+
* @return {*} {Promise<IShowSubsystemResponse>}
|
|
34
|
+
*/
|
|
35
|
+
export declare function showSubsystem(session: Session): Promise<IShowSubsystemResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* returns a list of rdf tables that match request
|
|
38
|
+
*
|
|
39
|
+
* @export
|
|
40
|
+
* @param {Session} session
|
|
41
|
+
* @param {string} subSystem
|
|
42
|
+
* @param {string} table
|
|
43
|
+
* @param {IHandlerParameters} params
|
|
44
|
+
* @return {*} {Promise<IShowLognameResponse>}
|
|
45
|
+
*/
|
|
46
|
+
export declare function showTable(session: Session, body: {
|
|
47
|
+
subSystem?: string;
|
|
48
|
+
table?: string;
|
|
49
|
+
}): Promise<IShowTableResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* returns a list of SSM parms
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
* @param {Session} session
|
|
55
|
+
* @param {string} subSystem
|
|
56
|
+
* @return {*} {Promise<IShowLognameResponse>}
|
|
57
|
+
*/
|
|
58
|
+
export declare function showSSMParms(session: Session, subSystem: string): Promise<IShowLognameResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* returns a list of OPSLOG records
|
|
61
|
+
*
|
|
62
|
+
* @export
|
|
63
|
+
* @param {Session} session
|
|
64
|
+
* @param {IShowRecordsCommandBody} body
|
|
65
|
+
* @param {string} subSystem
|
|
66
|
+
* @return {*} {Promise<IShowRecordsResponse>}
|
|
67
|
+
*/
|
|
68
|
+
export declare function showRecords(session: Session, body: IShowRecordsCommandBody, subSystem: string): Promise<IShowRecordsResponse>;
|