@broadcom/ops-for-zowe-cli 5.2.1 → 5.3.0
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/README.md +24 -8
- package/lib/api/Show.d.ts +30 -0
- package/lib/api/Show.js +30 -0
- package/lib/api/Show.js.map +1 -1
- package/lib/api/Update.d.ts +20 -2
- package/lib/api/Update.js +51 -12
- package/lib/api/Update.js.map +1 -1
- package/lib/api/doc/IShowRuleResponse.d.ts +1 -0
- package/lib/api/utils/RuleListUtils.d.ts +129 -0
- package/lib/api/utils/RuleListUtils.js +148 -3
- package/lib/api/utils/RuleListUtils.js.map +1 -1
- package/lib/api/utils/RuleUtils.d.ts +46 -1
- package/lib/api/utils/RuleUtils.js +46 -1
- package/lib/api/utils/RuleUtils.js.map +1 -1
- package/lib/cli/RexxParameterDefinitions.d.ts +1 -1
- package/lib/cli/RexxParameterDefinitions.js +2 -2
- package/lib/cli/RexxParameterDefinitions.js.map +1 -1
- package/lib/cli/disable/rule/Rule.handler.js +2 -1
- package/lib/cli/disable/rule/Rule.handler.js.map +1 -1
- package/lib/cli/enable/rule/Rule.definition.js +4 -1
- package/lib/cli/enable/rule/Rule.definition.js.map +1 -1
- package/lib/cli/enable/rule/Rule.handler.js +2 -1
- package/lib/cli/enable/rule/Rule.handler.js.map +1 -1
- package/lib/cli/resetAuto/ResetAutoenable.definition.d.ts +3 -0
- package/lib/cli/resetAuto/ResetAutoenable.definition.js +36 -0
- package/lib/cli/resetAuto/ResetAutoenable.definition.js.map +1 -0
- package/lib/cli/resetAuto/rule/Rule.definition.d.ts +2 -0
- package/lib/cli/resetAuto/rule/Rule.definition.js +50 -0
- package/lib/cli/resetAuto/rule/Rule.definition.js.map +1 -0
- package/lib/cli/resetAuto/rule/Rule.handler.d.ts +12 -0
- package/lib/cli/resetAuto/rule/Rule.handler.js +54 -0
- package/lib/cli/resetAuto/rule/Rule.handler.js.map +1 -0
- package/lib/cli/setAuto/SetAutoenable.definition.d.ts +3 -0
- package/lib/cli/setAuto/SetAutoenable.definition.js +36 -0
- package/lib/cli/setAuto/SetAutoenable.definition.js.map +1 -0
- package/lib/cli/setAuto/rule/Rule.definition.d.ts +2 -0
- package/lib/cli/setAuto/rule/Rule.definition.js +50 -0
- package/lib/cli/setAuto/rule/Rule.definition.js.map +1 -0
- package/lib/cli/setAuto/rule/Rule.handler.d.ts +12 -0
- package/lib/cli/setAuto/rule/Rule.handler.js +54 -0
- package/lib/cli/setAuto/rule/Rule.handler.js.map +1 -0
- package/lib/cli/show/ruleset/Ruleset.definition.js +1 -1
- package/lib/cli/show/ruleset/Ruleset.definition.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
# OPS/MVS® Plug-in for Zowe CLI
|
|
2
5
|
|
|
3
6
|
The Broadcom® OPS/MVS® Plug-in for Zowe CLI lets you interact with OPS/MVS automation elements, enabling efficient automation administration and resource management from a single command-line interface. The plug-in also lets you include automation administration and resource management in workflows to foster continuous integration.
|
|
@@ -6,6 +9,7 @@ The Broadcom® OPS/MVS® Plug-in for Zowe CLI lets you interact with OPS/MVS aut
|
|
|
6
9
|
Using the plug-in, you can benefit from the following OPS/MVS features:
|
|
7
10
|
- Display the status of specific automation rules and *rule sets.
|
|
8
11
|
- Enable and disable specific automation rules.
|
|
12
|
+
- *Set and reset auto-enable for specific automation rules.
|
|
9
13
|
- Display the state of specific System State Manager (SSM) resources.
|
|
10
14
|
- Start and stop specific SSM resources.
|
|
11
15
|
- *Display the status of a REST API server.
|
|
@@ -18,7 +22,7 @@ Using the plug-in, you can benefit from the following OPS/MVS features:
|
|
|
18
22
|
- *Execute a operator command.
|
|
19
23
|
- *Create a generic AOF event for API rules processing.
|
|
20
24
|
|
|
21
|
-
Note: *
|
|
25
|
+
Note: An asterisk (*) indicates the feature is only available if you are using the plug-in with the OPS/MVS REST API.
|
|
22
26
|
|
|
23
27
|
## Prerequisites
|
|
24
28
|
- Install [Zowe CLI](https://docs.zowe.org/stable/user-guide/cli-installcli/) on your computer.
|
|
@@ -168,7 +172,7 @@ When you enter a command using the OPS/MVS Plug-in for Zowe CLI, you will receiv
|
|
|
168
172
|
|
|
169
173
|
### create
|
|
170
174
|
|
|
171
|
-
- **create event
|
|
175
|
+
- **create event**
|
|
172
176
|
|
|
173
177
|
- Use the `create event` command to create a generic AOF event for API rules processing.
|
|
174
178
|
|
|
@@ -184,27 +188,39 @@ When you enter a command using the OPS/MVS Plug-in for Zowe CLI, you will receiv
|
|
|
184
188
|
|
|
185
189
|
- Use the `enable rule` command to enable the specified rule.
|
|
186
190
|
|
|
191
|
+
### set-auto
|
|
192
|
+
|
|
193
|
+
- **set-auto rule**
|
|
194
|
+
|
|
195
|
+
- Use the `set-auto rule` command to set the specified rule to auto-enable.
|
|
196
|
+
|
|
197
|
+
### reset-auto
|
|
198
|
+
|
|
199
|
+
- **reset-auto rule**
|
|
200
|
+
|
|
201
|
+
- Use the `reset-auto rule` command to reset (turn off) auto-enable for the specified rule.
|
|
202
|
+
|
|
187
203
|
### execute
|
|
188
204
|
|
|
189
|
-
- **execute command
|
|
205
|
+
- **execute command**
|
|
190
206
|
|
|
191
207
|
- Use the `execute command` command to execute the specified operator command.
|
|
192
208
|
|
|
193
|
-
- **execute rexx
|
|
209
|
+
- **execute rexx**
|
|
194
210
|
|
|
195
211
|
- Use the `execute rexx` command to execute the specified OPS/MVS REXX program.
|
|
196
212
|
|
|
197
213
|
### show
|
|
198
214
|
|
|
199
|
-
- **show logname
|
|
215
|
+
- **show logname**
|
|
200
216
|
|
|
201
217
|
- Use the `show logname` command to display the logs defined to a subsystem.
|
|
202
218
|
|
|
203
|
-
- **show parms
|
|
219
|
+
- **show parms**
|
|
204
220
|
|
|
205
221
|
- Use the `show parms` command to display all the SSM parameters defined to a subsystem.
|
|
206
222
|
|
|
207
|
-
- **show records
|
|
223
|
+
- **show records**
|
|
208
224
|
|
|
209
225
|
- 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
226
|
|
|
@@ -214,7 +230,7 @@ When you enter a command using the OPS/MVS Plug-in for Zowe CLI, you will receiv
|
|
|
214
230
|
|
|
215
231
|
- **show rule**
|
|
216
232
|
|
|
217
|
-
- Use the `show rule` command
|
|
233
|
+
- Use the `show rule` command to display data associated with the specified rule.
|
|
218
234
|
|
|
219
235
|
- **show ruleset***
|
|
220
236
|
|
package/lib/api/Show.d.ts
CHANGED
|
@@ -2,8 +2,38 @@ import { Session } from "@zowe/imperative";
|
|
|
2
2
|
import { IShowLognameResponse, IShowResourceResponse, IShowRuleResponse, IShowRulesetResponse, IShowStatusResponse, IShowSubsystemResponse, IShowRecordsResponse } from ".";
|
|
3
3
|
import { IShowTableResponse } from "./doc/IShowTableResponse";
|
|
4
4
|
import { IShowRecordsCommandBody } from "./doc/IShowRecordsCommandBody";
|
|
5
|
+
/**
|
|
6
|
+
* returns data for specified rule
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @param {Session} session
|
|
10
|
+
* @param {string} ruleSetName
|
|
11
|
+
* @param {string} ruleName
|
|
12
|
+
* @param {boolean} restApi
|
|
13
|
+
* @param {string} subSystem
|
|
14
|
+
* @return {*} {Promise<IShowRuleResponse>}
|
|
15
|
+
*/
|
|
5
16
|
export declare function showRule(session: Session, ruleSetName: string, ruleName: string, restApi: boolean, subSystem: string): Promise<IShowRuleResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* returns data for specified resource
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @param {Session} session
|
|
22
|
+
* @param {string} resourceName
|
|
23
|
+
* @param {boolean} restApi
|
|
24
|
+
* @param {string} table
|
|
25
|
+
* @param {string} subsystem
|
|
26
|
+
* @return {*} {Promise<IShowResourceResponse>}
|
|
27
|
+
*/
|
|
6
28
|
export declare function showResource(session: Session, resourceName: string, restApi: boolean, table: string, subsystem: string): Promise<IShowResourceResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* returns ruleset data
|
|
31
|
+
*
|
|
32
|
+
* @export
|
|
33
|
+
* @param {Session} session
|
|
34
|
+
* @param {{ ruleSetName: string, subSystem: string }} body
|
|
35
|
+
* @return {*} {Promise<IShowRulesetResponse>}
|
|
36
|
+
*/
|
|
7
37
|
export declare function showRuleset(session: Session, body: {
|
|
8
38
|
ruleSetName: string;
|
|
9
39
|
subSystem: string;
|
package/lib/api/Show.js
CHANGED
|
@@ -35,6 +35,17 @@ exports.showRecords = exports.showSSMParms = exports.showTable = exports.showSub
|
|
|
35
35
|
const utils_1 = require("./utils");
|
|
36
36
|
const constants_1 = require("./constants");
|
|
37
37
|
const OpsRestClient_1 = require("./utils/OpsRestClient");
|
|
38
|
+
/**
|
|
39
|
+
* returns data for specified rule
|
|
40
|
+
*
|
|
41
|
+
* @export
|
|
42
|
+
* @param {Session} session
|
|
43
|
+
* @param {string} ruleSetName
|
|
44
|
+
* @param {string} ruleName
|
|
45
|
+
* @param {boolean} restApi
|
|
46
|
+
* @param {string} subSystem
|
|
47
|
+
* @return {*} {Promise<IShowRuleResponse>}
|
|
48
|
+
*/
|
|
38
49
|
function showRule(session, ruleSetName, ruleName, restApi, subSystem) {
|
|
39
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
51
|
const ruleUrl = utils_1.RuleUtils.getRuleURL(session, ruleSetName, ruleName, restApi, subSystem);
|
|
@@ -42,6 +53,17 @@ function showRule(session, ruleSetName, ruleName, restApi, subSystem) {
|
|
|
42
53
|
});
|
|
43
54
|
}
|
|
44
55
|
exports.showRule = showRule;
|
|
56
|
+
/**
|
|
57
|
+
* returns data for specified resource
|
|
58
|
+
*
|
|
59
|
+
* @export
|
|
60
|
+
* @param {Session} session
|
|
61
|
+
* @param {string} resourceName
|
|
62
|
+
* @param {boolean} restApi
|
|
63
|
+
* @param {string} table
|
|
64
|
+
* @param {string} subsystem
|
|
65
|
+
* @return {*} {Promise<IShowResourceResponse>}
|
|
66
|
+
*/
|
|
45
67
|
function showResource(session, resourceName, restApi, table, subsystem) {
|
|
46
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
69
|
const resourceUrl = utils_1.SSMResourceUtils.getResourceURL(session, resourceName, restApi, table, subsystem);
|
|
@@ -49,6 +71,14 @@ function showResource(session, resourceName, restApi, table, subsystem) {
|
|
|
49
71
|
});
|
|
50
72
|
}
|
|
51
73
|
exports.showResource = showResource;
|
|
74
|
+
/**
|
|
75
|
+
* returns ruleset data
|
|
76
|
+
*
|
|
77
|
+
* @export
|
|
78
|
+
* @param {Session} session
|
|
79
|
+
* @param {{ ruleSetName: string, subSystem: string }} body
|
|
80
|
+
* @return {*} {Promise<IShowRulesetResponse>}
|
|
81
|
+
*/
|
|
52
82
|
function showRuleset(session, body) {
|
|
53
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
84
|
const rulesetUrl = utils_1.RulesetUtils.getRulesetURL(session, body.ruleSetName, body.subSystem);
|
package/lib/api/Show.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Show.js","sourceRoot":"","sources":["../../src/api/Show.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAGH,mCAUiB;AACjB,2CAA2C;AAU3C,yDAAsD;AAKtD,SAAsB,QAAQ,CAC5B,OAAgB,EAChB,WAAmB,EACnB,QAAgB,EAChB,OAAgB,EAChB,SAAiB;;QAEjB,MAAM,OAAO,GAAG,iBAAS,CAAC,UAAU,CAClC,OAAO,EACP,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,CACV,CAAC;QACF,OAAO,6BAAa,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,wBAAY,CAAC,OAAO,CAAC,CAAC;IAC7E,CAAC;CAAA;AAfD,4BAeC;AAED,SAAsB,YAAY,CAChC,OAAgB,EAChB,YAAoB,EACpB,OAAgB,EAChB,KAAa,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"@zowe/imperative";
|
|
2
|
-
export declare function updateRule(session: Session, ruleSetName: string, ruleName: string, newStatus: string, restApi: boolean, subSystem?: string): Promise<{}>;
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* update the enablement or auto-enablement status of a rule
|
|
4
|
+
*
|
|
5
|
+
* @export
|
|
6
|
+
* @param {Session} session
|
|
7
|
+
* @param {IHandlerParameters} params
|
|
8
|
+
* @return {*} {Promise<{}>}
|
|
9
|
+
*/
|
|
10
|
+
export declare function updateRule(session: Session, params: any): Promise<{}>;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @param {Session} session
|
|
16
|
+
* @param {string} resource
|
|
17
|
+
* @param {boolean} restApi
|
|
18
|
+
* @param {string} desiredState
|
|
19
|
+
* @param {string} [subsystem]
|
|
20
|
+
* @param {string} [table]
|
|
21
|
+
* @param {number} [wait]
|
|
22
|
+
* @return {*} {Promise<{}>}
|
|
5
23
|
*/
|
|
6
24
|
export declare function updateResource(session: Session, resource: string, restApi: boolean, desiredState: string, subsystem?: string, table?: string, wait?: number): Promise<{}>;
|
package/lib/api/Update.js
CHANGED
|
@@ -38,13 +38,29 @@ const utils_1 = require("./utils");
|
|
|
38
38
|
const ResourceParameterDefinitions_1 = require("../cli/ResourceParameterDefinitions");
|
|
39
39
|
const Show_1 = require("./Show");
|
|
40
40
|
const OpsRestClient_1 = require("./utils/OpsRestClient");
|
|
41
|
-
|
|
41
|
+
/**
|
|
42
|
+
* update the enablement or auto-enablement status of a rule
|
|
43
|
+
*
|
|
44
|
+
* @export
|
|
45
|
+
* @param {Session} session
|
|
46
|
+
* @param {IHandlerParameters} params
|
|
47
|
+
* @return {*} {Promise<{}>}
|
|
48
|
+
*/
|
|
49
|
+
function updateRule(session, params) {
|
|
42
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const ruleUrl = utils_1.RuleUtils.getRuleURL(session,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
const ruleUrl = utils_1.RuleUtils.getRuleURL(session, params.arguments.ruleset, params.arguments.rule, params.arguments.restApi, params.arguments.subSystem);
|
|
52
|
+
let body;
|
|
53
|
+
if (params.arguments.autoStatus) {
|
|
54
|
+
body = {
|
|
55
|
+
autoEnabled: params.arguments.autoStatus,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
else if (params.arguments.newStatus) {
|
|
59
|
+
body = {
|
|
60
|
+
status: params.arguments.newStatus,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (params.arguments.restApi === false) {
|
|
48
64
|
return OpsRestClient_1.OpsRestClient.postExpectJSON(session, ruleUrl, constants_1.OpsConstants.headers, body);
|
|
49
65
|
}
|
|
50
66
|
else {
|
|
@@ -54,7 +70,17 @@ function updateRule(session, ruleSetName, ruleName, newStatus, restApi, subSyste
|
|
|
54
70
|
}
|
|
55
71
|
exports.updateRule = updateRule;
|
|
56
72
|
/**
|
|
57
|
-
*
|
|
73
|
+
*
|
|
74
|
+
*
|
|
75
|
+
* @export
|
|
76
|
+
* @param {Session} session
|
|
77
|
+
* @param {string} resource
|
|
78
|
+
* @param {boolean} restApi
|
|
79
|
+
* @param {string} desiredState
|
|
80
|
+
* @param {string} [subsystem]
|
|
81
|
+
* @param {string} [table]
|
|
82
|
+
* @param {number} [wait]
|
|
83
|
+
* @return {*} {Promise<{}>}
|
|
58
84
|
*/
|
|
59
85
|
function updateResource(session, resource, restApi, desiredState, subsystem, table, wait) {
|
|
60
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -63,10 +89,10 @@ function updateResource(session, resource, restApi, desiredState, subsystem, tab
|
|
|
63
89
|
}
|
|
64
90
|
const resourceUrl = utils_1.SSMResourceUtils.getResourceURLWithQueryParms(session, resource, restApi, table, subsystem);
|
|
65
91
|
const postBody = {
|
|
66
|
-
desired: desiredState
|
|
92
|
+
desired: desiredState,
|
|
67
93
|
};
|
|
68
94
|
const postBodyRestApi = {
|
|
69
|
-
desiredState: desiredState
|
|
95
|
+
desiredState: desiredState,
|
|
70
96
|
};
|
|
71
97
|
let response;
|
|
72
98
|
if (restApi) {
|
|
@@ -85,6 +111,18 @@ function updateResource(session, resource, restApi, desiredState, subsystem, tab
|
|
|
85
111
|
});
|
|
86
112
|
}
|
|
87
113
|
exports.updateResource = updateResource;
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
*
|
|
117
|
+
* @param {*} response
|
|
118
|
+
* @param {Session} session
|
|
119
|
+
* @param {string} resource$desiredState
|
|
120
|
+
* @param {boolean} restApi
|
|
121
|
+
* @param {string} [subsystem]
|
|
122
|
+
* @param {string} [table]
|
|
123
|
+
* @param {number} [wait]
|
|
124
|
+
* @return {*} {Promise<{}>}
|
|
125
|
+
*/
|
|
88
126
|
function processWait(response, session, resource$desiredState, restApi, subsystem, table, wait) {
|
|
89
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
128
|
// we are waiting, so set up the polling to determine if current = desired state
|
|
@@ -101,7 +139,8 @@ function processWait(response, session, resource$desiredState, restApi, subsyste
|
|
|
101
139
|
currentState = response.currentState;
|
|
102
140
|
}
|
|
103
141
|
else {
|
|
104
|
-
if (response.ssmresource[0].current.toUpperCase() ===
|
|
142
|
+
if (response.ssmresource[0].current.toUpperCase() ===
|
|
143
|
+
desiredState.toUpperCase()) {
|
|
105
144
|
return response;
|
|
106
145
|
}
|
|
107
146
|
currentState = response.ssmresource[0].current;
|
|
@@ -112,7 +151,7 @@ function processWait(response, session, resource$desiredState, restApi, subsyste
|
|
|
112
151
|
const start = new Date().getTime();
|
|
113
152
|
// looping with 'wait' value as max was taking approximately twice the requested time
|
|
114
153
|
// so use the actual time to calculate when the 'wait' time is exceeded
|
|
115
|
-
while ((
|
|
154
|
+
while ((new Date().getTime() - start) / ONE_SECOND < wait) {
|
|
116
155
|
pollResponse = yield (0, Show_1.showResource)(session, resource, restApi, table, subsystem);
|
|
117
156
|
if (restApi) {
|
|
118
157
|
currentState = pollResponse[0].currentState;
|
|
@@ -134,7 +173,7 @@ function processWait(response, session, resource$desiredState, restApi, subsyste
|
|
|
134
173
|
// if we get here, the timeout was exceeded.
|
|
135
174
|
throw new imperative_1.ImperativeError({
|
|
136
175
|
msg: `The requested wait time of ${wait} second${wait > 1 ? "s" : ""} was exceeded and the current state` +
|
|
137
|
-
` of resource '${resource}' is still ${currentState}
|
|
176
|
+
` of resource '${resource}' is still ${currentState}.`,
|
|
138
177
|
});
|
|
139
178
|
});
|
|
140
179
|
}
|
package/lib/api/Update.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Update.js","sourceRoot":"","sources":["../../src/api/Update.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAEH,iDAA8E;AAC9E,2CAA2C;AAC3C,mCAAsD;AACtD,sFAAmF;AACnF,iCAAsC;AACtC,yDAAsD;
|
|
1
|
+
{"version":3,"file":"Update.js","sourceRoot":"","sources":["../../src/api/Update.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAEH,iDAA8E;AAC9E,2CAA2C;AAC3C,mCAAsD;AACtD,sFAAmF;AACnF,iCAAsC;AACtC,yDAAsD;AAGtD;;;;;;;GAOG;AACH,SAAsB,UAAU,CAAC,OAAgB,EAAE,MAAW;;QAC5D,MAAM,OAAO,GAAG,iBAAS,CAAC,UAAU,CAClC,OAAO,EACP,MAAM,CAAC,SAAS,CAAC,OAAO,EACxB,MAAM,CAAC,SAAS,CAAC,IAAI,EACrB,MAAM,CAAC,SAAS,CAAC,OAAO,EACxB,MAAM,CAAC,SAAS,CAAC,SAAS,CAC3B,CAAC;QACF,IAAI,IAAI,CAAC;QACT,IAAI,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE;YAC/B,IAAI,GAAG;gBACL,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,U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AG,IAAI,CAAC;QACxB,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACnC,qFAAqF;QACrF,uEAAuE;QACvE,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,GAAG,UAAU,GAAG,IAAI,EAAE;YACzD,YAAY,GAAG,MAAM,IAAA,mBAAY,EAC/B,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAS,CACV,CAAC;YACF,IAAI,OAAO,EAAE;gBACX,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;aAC7C;iBAAM;gBACL,YAAY,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;aACpD;YACD,IAAI,YAAY,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,EAAE,EAAE;gBAC7D,wEAAwE;gBACxE,OAAO,YAAY,CAAC;aACrB;iBAAM;gBACL,mDAAmD;gBACnD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC5B,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;gBAClC,CAAC,CAAC,CAAC;aACJ;SACF;QAED,4CAA4C;QAC5C,MAAM,IAAI,4BAAe,CAAC;YACxB,GAAG,EACD,8BAA8B,IAAI,UAChC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EACnB,qCAAqC;gBACrC,iBAAiB,QAAQ,cAAc,YAAY,GAAG;SACzD,CAAC,CAAC;IACL,CAAC;CAAA"}
|
|
@@ -1,18 +1,147 @@
|
|
|
1
1
|
import { IHandlerParameters } from "@zowe/imperative";
|
|
2
2
|
export declare class RuleListUtils {
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @static
|
|
7
|
+
* @param {*} ruleList
|
|
8
|
+
* @param {IHandlerParameters} params
|
|
9
|
+
* @return {*}
|
|
10
|
+
* @memberof RuleListUtils
|
|
11
|
+
*/
|
|
3
12
|
static printRuleStatusResponse(ruleList: any, params: IHandlerParameters): string;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* @static
|
|
17
|
+
* @param {*} ruleList
|
|
18
|
+
* @param {IHandlerParameters} params
|
|
19
|
+
* @return {*}
|
|
20
|
+
* @memberof RuleListUtils
|
|
21
|
+
*/
|
|
4
22
|
static printShowRuleResponse(ruleList: any, params: IHandlerParameters): string;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* @static
|
|
27
|
+
* @param {*} ruleList
|
|
28
|
+
* @return {*}
|
|
29
|
+
* @memberof RuleListUtils
|
|
30
|
+
*/
|
|
5
31
|
static formatOutputNotRestApi(ruleList: any): string;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
* @static
|
|
36
|
+
* @param {*} ruleList
|
|
37
|
+
* @param {IHandlerParameters} params
|
|
38
|
+
* @return {*}
|
|
39
|
+
* @memberof RuleListUtils
|
|
40
|
+
*/
|
|
6
41
|
static formatRestApiRuleList(ruleList: any, params: IHandlerParameters): string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
* @static
|
|
46
|
+
* @param {*} rule
|
|
47
|
+
* @param {number} i
|
|
48
|
+
* @param {IHandlerParameters} params
|
|
49
|
+
* @return {*}
|
|
50
|
+
* @memberof RuleListUtils
|
|
51
|
+
*/
|
|
7
52
|
static formatOutputFromArrayRestApi(rule: any, i: number, params: IHandlerParameters): string;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*
|
|
56
|
+
* @static
|
|
57
|
+
* @param {*} rule
|
|
58
|
+
* @param {IHandlerParameters} params
|
|
59
|
+
* @return {*}
|
|
60
|
+
* @memberof RuleListUtils
|
|
61
|
+
*/
|
|
8
62
|
static formatOutputRestApi(rule: any, params: IHandlerParameters): string;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* @static
|
|
67
|
+
* @param {string} system
|
|
68
|
+
* @param {string} ruleSet
|
|
69
|
+
* @param {string} ruleName
|
|
70
|
+
* @return {*} {string}
|
|
71
|
+
* @memberof RuleListUtils
|
|
72
|
+
*/
|
|
9
73
|
static formatRuleResponseNameWithColor(system: string, ruleSet: string, ruleName: string): string;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
*
|
|
77
|
+
* @static
|
|
78
|
+
* @param {string} newStatus
|
|
79
|
+
* @param {string} oldStatus
|
|
80
|
+
* @return {*} {string}
|
|
81
|
+
* @memberof RuleListUtils
|
|
82
|
+
*/
|
|
10
83
|
static formatStatusResponse(newStatus: string, oldStatus: string): string;
|
|
84
|
+
static formatAutoStatusResponse(ruleList: any): string;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
*
|
|
88
|
+
* @static
|
|
89
|
+
* @param {string} status
|
|
90
|
+
* @return {*} {string}
|
|
91
|
+
* @memberof RuleListUtils
|
|
92
|
+
*/
|
|
11
93
|
static formatShowResponse(status: string): string;
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
*
|
|
97
|
+
* @static
|
|
98
|
+
* @param {*} ruleList
|
|
99
|
+
* @return {*} {string}
|
|
100
|
+
* @memberof RuleListUtils
|
|
101
|
+
*/
|
|
12
102
|
static formatShowAllRuleResponse(ruleList: any): string;
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
*
|
|
106
|
+
* @static
|
|
107
|
+
* @param {*} ruleList
|
|
108
|
+
* @return {*} {string}
|
|
109
|
+
* @memberof RuleListUtils
|
|
110
|
+
*/
|
|
13
111
|
static formatShowAllRuleResponseWithColor(ruleList: any): string;
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
*
|
|
115
|
+
* @static
|
|
116
|
+
* @param {*} ruleList
|
|
117
|
+
* @return {*} {string}
|
|
118
|
+
* @memberof RuleListUtils
|
|
119
|
+
*/
|
|
14
120
|
static formatAllDataResponseJson(ruleList: any): string;
|
|
121
|
+
/**
|
|
122
|
+
*
|
|
123
|
+
*
|
|
124
|
+
* @static
|
|
125
|
+
* @return {*} {string}
|
|
126
|
+
* @memberof RuleListUtils
|
|
127
|
+
*/
|
|
15
128
|
static formatAllCsvHeaderResponse(): string;
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
*
|
|
132
|
+
* @static
|
|
133
|
+
* @param {*} ruleList
|
|
134
|
+
* @return {*} {string}
|
|
135
|
+
* @memberof RuleListUtils
|
|
136
|
+
*/
|
|
16
137
|
static formatAllCsvDataResponse(ruleList: any): string;
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
*
|
|
141
|
+
* @static
|
|
142
|
+
* @param {IHandlerParameters} params
|
|
143
|
+
* @return {*} {string}
|
|
144
|
+
* @memberof RuleListUtils
|
|
145
|
+
*/
|
|
17
146
|
static printShowRuleError(params: IHandlerParameters): string;
|
|
18
147
|
}
|