Skip to content

Commit 36a9eba

Browse files
Ready for review? Blank DS template
Signed-off-by: katelynienaber <[email protected]>
1 parent 36654d0 commit 36a9eba

16 files changed

+432
-10
lines changed

docs/CLIReadme.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ interval\.
17891789

17901790
* `commandtext` *(string)*
17911791

1792-
* The z/OS console command to issue
1792+
* The z/OS console command to issue.
17931793

17941794
#### Options
17951795

@@ -1847,7 +1847,7 @@ interval\.
18471847

18481848
* `--follow-up-attempts` | `--fua` | `-a` *(number)*
18491849

1850-
* Number of request attempts if no response returned
1850+
* Number of request attempts if no response returned.
18511851

18521852
Default value: 1
18531853

@@ -1901,6 +1901,11 @@ coordinated universal time and date:
19011901

19021902
* `$ zowe zos-console issue command "D T"`
19031903

1904+
* Issue a Db2 command to display information about the status
1905+
and configuration of DDF:
1906+
1907+
* `$ zowe zos-console issue command "\-DB1G DISPLAY DDF"`
1908+
19041909
# zos-files | files<a name="zos-files"></a>
19051910
Manage z/OS data sets, create data sets, and more
19061911
## create | cre<a name="zos-files-create"></a>

packages/cli/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the Zowe CLI package will be documented in this file.
44

5+
## Recent Changes
6+
7+
- Enhancement: Added an example for running a Db2 command with the `zowe zos-console issue command` command. [#641](https://github.com/zowe/zowe-cli/issues/641)
8+
59
## `6.26.0`
610

711
- Enhancement: Updated Imperative version to support npm@7. This fixes an error when installing plugins.

packages/cli/__tests__/zosconsole/__integration__/issue/__snapshots__/cli.zos-console.issue.command.integration.test.ts.snap

+9-4
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* This program and the accompanying materials are made available under the terms of the
3+
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
4+
* https://www.eclipse.org/legal/epl-v20.html
5+
*
6+
* SPDX-License-Identifier: EPL-2.0
7+
*
8+
* Copyright Contributors to the Zowe Project.
9+
*
10+
*/
11+
12+
import { ICommandDefinition } from "@zowe/imperative";
13+
14+
describe("zos-console group definition", () => {
15+
it("should not have changed", () => {
16+
const CHILDREN = 2;
17+
const definition: ICommandDefinition = require("../../../src/zosconsole/ZosConsole.definition");
18+
expect(definition).toBeDefined();
19+
expect(definition.children.length).toBe(CHILDREN);
20+
delete definition.children;
21+
expect(definition).toMatchSnapshot();
22+
});
23+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`zos-console group definition should not have changed 1`] = `
4+
Object {
5+
"aliases": Array [
6+
"console",
7+
],
8+
"description": "Interact with z/OSMF console services. Issue z/OS console commands and collect responses. z/OS console services establishes extended MCS (EMCS) consoles on behalf of the user, which are used to issue the commands and collect responses.
9+
10+
Important! Before you use commands in the zos-console command group, ensure that you understand the implications of issuing z/OS console commands in your environment.",
11+
"name": "zos-console",
12+
"passOn": Array [
13+
Object {
14+
"ignoreNodes": Array [
15+
Object {
16+
"type": "group",
17+
},
18+
],
19+
"merge": true,
20+
"property": "options",
21+
"value": Array [
22+
Object {
23+
"aliases": Array [
24+
"H",
25+
],
26+
"description": "The z/OSMF server host name.",
27+
"group": "Zosmf Connection Options",
28+
"name": "host",
29+
"required": false,
30+
"type": "string",
31+
},
32+
Object {
33+
"aliases": Array [
34+
"P",
35+
],
36+
"defaultValue": 443,
37+
"description": "The z/OSMF server port.",
38+
"group": "Zosmf Connection Options",
39+
"name": "port",
40+
"type": "number",
41+
},
42+
Object {
43+
"aliases": Array [
44+
"u",
45+
],
46+
"description": "Mainframe (z/OSMF) user name, which can be the same as your TSO login.",
47+
"group": "Zosmf Connection Options",
48+
"name": "user",
49+
"required": false,
50+
"type": "string",
51+
},
52+
Object {
53+
"aliases": Array [
54+
"pass",
55+
"pw",
56+
],
57+
"description": "Mainframe (z/OSMF) password, which can be the same as your TSO password.",
58+
"group": "Zosmf Connection Options",
59+
"name": "password",
60+
"required": false,
61+
"type": "string",
62+
},
63+
Object {
64+
"aliases": Array [
65+
"ru",
66+
],
67+
"defaultValue": true,
68+
"description": "Reject self-signed certificates.",
69+
"group": "Zosmf Connection Options",
70+
"name": "reject-unauthorized",
71+
"type": "boolean",
72+
},
73+
Object {
74+
"aliases": Array [
75+
"bp",
76+
],
77+
"description": "The base path for your API mediation layer instance. Specify this option to prepend the base path to all z/OSMF resources when making REST requests. Do not specify this option if you are not using an API mediation layer.",
78+
"group": "Zosmf Connection Options",
79+
"name": "base-path",
80+
"type": "string",
81+
},
82+
],
83+
},
84+
],
85+
"summary": "Issue z/OS console commands and collect responses",
86+
"type": "group",
87+
}
88+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* This program and the accompanying materials are made available under the terms of the
3+
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
4+
* https://www.eclipse.org/legal/epl-v20.html
5+
*
6+
* SPDX-License-Identifier: EPL-2.0
7+
*
8+
* Copyright Contributors to the Zowe Project.
9+
*
10+
*/
11+
12+
import { ICommandDefinition } from "@zowe/imperative";
13+
14+
describe("zos-console issue group definition", () => {
15+
it("should not have changed", () => {
16+
const definition: ICommandDefinition = require("../../../../src/zosconsole/issue/Issue.definition").IssueCommand;
17+
expect(definition).toBeDefined();
18+
expect(definition.children.length).toBe(1);
19+
delete definition.children;
20+
expect(definition).toMatchSnapshot();
21+
});
22+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`zos-console issue group definition should not have changed 1`] = `
4+
Object {
5+
"description": "Issue z/OS console commands and optionally collect responses.",
6+
"name": "issue",
7+
"summary": "Issue z/OS Console Commands",
8+
"type": "group",
9+
}
10+
`;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* This program and the accompanying materials are made available under the terms of the
3+
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
4+
* https://www.eclipse.org/legal/epl-v20.html
5+
*
6+
* SPDX-License-Identifier: EPL-2.0
7+
*
8+
* Copyright Contributors to the Zowe Project.
9+
*
10+
*/
11+
12+
import { ICommandDefinition } from "@zowe/imperative";
13+
14+
describe("zos-console issue command definition", () => {
15+
it("should not have changed", () => {
16+
const definition: ICommandDefinition = require
17+
("../../../../../src/zosconsole/issue/command/Command.definition").IssueCommandDefinition;
18+
delete definition.handler;
19+
expect(definition).toBeDefined();
20+
delete definition.handler;
21+
expect(definition).toMatchSnapshot();
22+
});
23+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`zos-console issue command definition should not have changed 1`] = `
4+
Object {
5+
"aliases": Array [
6+
"cmd",
7+
],
8+
"description": "Issue a z/OS console command and print command responses (known as \\"solicited command responses\\").
9+
10+
In general, when issuing a z/OS console command, z/OS applications route responses to the originating console. The command response messages are referred to as \\"solicited command responses\\" (i.e. direct responses to the command issued). When issuing a z/OS console command using Zowe CLI, collection of all solicited command responses is attempted by default. However, there is no z/OS mechanism that indicates the total number of response messages that may be produced from a given command. Therefore, the Zowe CLI console APIs return a \\"solicited response key\\" that can be used to \\"follow-up\\" and collect any additional solicited command responses.
11+
12+
Zowe CLI will issue \\"follow-up\\" API requests by default to collect any additional outstanding solicited command responses until a request returns no additional responses. At that time, Zowe CLI will attempt a final collection attempt. If no messages are present, the command is complete. If additional messages are present, the process is repeated. However, this does not guarantee that all messages produced in direct response (i.e. solicited) have been collected. The z/OS application may produce additional messages in direct response to your command at some point in the future. You can manually collect additional responses using the \\"command response key\\" OR specify additional processing options to, for example, delay collection attempts by a specified interval.",
13+
"examples": Array [
14+
Object {
15+
"description": "Issue a z/OS console command to display the IPL information for the system",
16+
"options": "\\"D IPLINFO\\"",
17+
},
18+
Object {
19+
"description": "Issue a z/OS console command to display the local and coordinated universal time and date",
20+
"options": "\\"D T\\"",
21+
},
22+
Object {
23+
"description": "Issue a Db2 command to display information about the status and configuration of DDF",
24+
"options": "\\"\\\\-DB1G DISPLAY DDF\\"",
25+
},
26+
],
27+
"name": "command",
28+
"options": Array [
29+
Object {
30+
"aliases": Array [
31+
"cn",
32+
"c",
33+
],
34+
"allowableValues": Object {
35+
"caseSensitive": false,
36+
"values": Array [
37+
"^[a-zA-Z0-9]+$",
38+
],
39+
},
40+
"description": "The name of the z/OS extended MCS console to direct the command. You must have the required authority to access the console specified. You may also specify an arbitrary name, if your installation allows dynamic creation of consoles with arbitrary names.",
41+
"name": "console-name",
42+
"type": "string",
43+
},
44+
Object {
45+
"aliases": Array [
46+
"id",
47+
"i",
48+
],
49+
"description": "Include additional details at the end of the Zowe CLI command response, such as the \\"command response key\\" and the z/OSMF command response URL.",
50+
"name": "include-details",
51+
"type": "boolean",
52+
},
53+
Object {
54+
"aliases": Array [
55+
"ko",
56+
"k",
57+
],
58+
"description": "Displays only the \\"command response key\\" returned from the z/OSMF console API. You can collect additional messages using the command key with 'zowe zos-console collect sync-responses <key>'. Note that when using this option, you will not be presented with the \\"first set\\" of command response messages (if present in the API response). However, you can view them by using the --response-format-json option.",
59+
"name": "key-only",
60+
"type": "boolean",
61+
},
62+
Object {
63+
"aliases": Array [
64+
"rf",
65+
"r",
66+
],
67+
"conflictsWith": Array [
68+
"wait-to-collect",
69+
],
70+
"description": "Indicates that Zowe CLI should return immediately with the response message set returned in the first z/OSMF API request (even if no responses are present). Using this option may result in partial or no response, but quicker Zowe CLI command response time. The z/OSMF console API has an implicit wait when collecting the first set of console command responses, i.e you will normally receive at least one set of response messages.",
71+
"name": "return-first",
72+
"type": "boolean",
73+
},
74+
Object {
75+
"aliases": Array [
76+
"sk",
77+
"s",
78+
],
79+
"description": "For solicited responses (direct command responses) the response is considered complete if the keyword specified is present. If the keyword is detected, the command will immediately return, meaning the full command response may not be provided. The key only applies to the first request issued, follow up requests do not support searching for the keyword.",
80+
"name": "solicited-keyword",
81+
"type": "string",
82+
},
83+
Object {
84+
"aliases": Array [
85+
"ss",
86+
"sys",
87+
],
88+
"description": "Specifies the z/OS system (LPAR) in the current SYSPLEX (where your target z/OSMF resides) to route the z/OS console command.",
89+
"name": "sysplex-system",
90+
"type": "string",
91+
},
92+
Object {
93+
"aliases": Array [
94+
"wtc",
95+
"w",
96+
],
97+
"conflictsWith": Array [
98+
"return-first",
99+
],
100+
"description": "Indicates that Zowe CLI wait at least the specified number of seconds before attempting to collect additional solicited response messages. If additional messages are collected on \\"follow-up\\" requests, the timer is reset until an attempt is made that results in no additional response messages.",
101+
"name": "wait-to-collect",
102+
"type": "number",
103+
},
104+
Object {
105+
"aliases": Array [
106+
"fua",
107+
"a",
108+
],
109+
"defaultValue": "1",
110+
"description": "Number of request attempts if no response returned.",
111+
"name": "follow-up-attempts",
112+
"type": "number",
113+
},
114+
],
115+
"positionals": Array [
116+
Object {
117+
"description": "The z/OS console command to issue.",
118+
"name": "commandtext",
119+
"required": true,
120+
"type": "string",
121+
},
122+
],
123+
"profile": Object {
124+
"optional": Array [
125+
"zosmf",
126+
],
127+
},
128+
"summary": "Issue a z/OS console command and print the response",
129+
"type": "command",
130+
}
131+
`;

packages/cli/src/zosconsole/issue/command/Command.definition.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const IssueCommandDefinition: ICommandDefinition = {
4242
{
4343
name: "commandtext",
4444
type: "string",
45-
description: "The z/OS console command to issue",
45+
description: "The z/OS console command to issue.",
4646
required: true
4747
}
4848
],
@@ -119,7 +119,7 @@ export const IssueCommandDefinition: ICommandDefinition = {
119119
{
120120
name: "follow-up-attempts",
121121
aliases: ["fua", "a"],
122-
description: "Number of request attempts if no response returned",
122+
description: "Number of request attempts if no response returned.",
123123
type: "number",
124124
defaultValue: "1"
125125
}
@@ -132,6 +132,10 @@ export const IssueCommandDefinition: ICommandDefinition = {
132132
{
133133
description: "Issue a z/OS console command to display the local and coordinated universal time and date",
134134
options: "\"D T\""
135+
},
136+
{
137+
description: "Issue a Db2 command to display information about the status and configuration of DDF",
138+
options: "\"\\-DB1G DISPLAY DDF\""
135139
}
136140
]
137141
};

packages/cli/src/zosfiles/-strings-/en.ts

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ export default {
5252
EX1: "Create an empty physical sequential data set with default parameters"
5353
}
5454
},
55+
DATA_SET_BLANK: {
56+
DESCRIPTION: "Create blank data sets",
57+
EXAMPLES: {
58+
EX1: "Create a data set using only passed-in parameters (no defaults set)"
59+
}
60+
},
5561
VSAM: {
5662
DESCRIPTION: "Create a VSAM cluster",
5763
POSITIONALS: {

0 commit comments

Comments
 (0)