Skip to content

Commit

Permalink
address PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: zFernand0 <[email protected]>
  • Loading branch information
zFernand0 committed Mar 8, 2024
1 parent e568aca commit e8096a8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
65 changes: 36 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# z/OS FTP Plug-in for Zowe™ CLI

The z/OS FTP Plug-in for Zowe™ CLI lets you access z/OS datasets, USS files, and submit JCL, leveraging the z/OS FTP service. The plug-in lets you perform these z/OS operations through the Zowe CLI client without the use of IBM z/OSMF on the back end (such as situations where z/OSMF is down).
The z/OS FTP Plug-in for Zowe™ CLI lets you access z/OS data sets, USS files, and submit JCL, leveraging the z/OS FTP service. The plug-in lets you perform these z/OS operations through the Zowe CLI client without the use of IBM z/OSMF on the back end (such as situations where z/OSMF is down).

## How the plug-in works

This plug-in uses the [zos-node-accessor package](https://github.com/IBM/zos-node-accessor), intending to be as close as possible to the corresponding commands in core Zowe CLI in terms of syntax and response. However, there may be times where they differ slightly due to technical details of the zos-node-accessor package.

You can use the plug-in to perform various tasks, such as the following:
You can use the plug-in to perform various tasks:

* List, view, rename, or download z/OS dataset, partitioned dataset members or USS file.
* Upload local file or stdin to z/OS dataset or USS file.
* List, view or download job status, job spool files.
* Delete z/OS dataset, USS file, or job.
* Submit job from dataset, local file and stdin.
* Make USS directory.
* Allocate dataset.
* List, view, rename, or download a z/OS data set, partitioned dataset members or USS file.
* Upload a local file or the standard input (stdin) to a z/OS data set or USS file.
* List, view or download a job status and job spool files.
* Delete z/OS data sets, USS files, or jobs.
* Submit a job from a z/OS data set, a local file or the standard input (stdin).
* Create a USS directory.
* Allocate a z/OS data set.

## Software Requirements
## Software requirements

Before you install the plug-in, meet the following requirements:

* Install Zowe CLI on your PC.

**Note:** For more information, see [Installing Zowe CLI](https://docs.zowe.org/active-development/user-guide/cli-installcli.html).

* Check to ensure z/OS FTP service can be accessed remotely. Connect z/OS with the FTP client and run command `rstat` in FTP client to check the option JESINTERFACELevel is set to 2.
* Ensure the z/OS FTP service can be accessed remotely by connecting to z/OS from an FTP client. From the FTP client, run the command `rstat` to verify that the option `JESINTERFACELevel` is set to 2.

## Build the Plug-in from Source
## Build the plug-in from source

**Follow these steps:**

1. The first time that you download the z/OS FTP Plugin from the GitHub repository, issue the following command against the local directory:
1. Download the z/OS FTP plug-in source from the GitHub repository and issue the following command in the local directory:

```
npm install
Expand All @@ -44,17 +44,15 @@ Before you install the plug-in, meet the following requirements:
npm run build
```
The first time you build your code changes, you will be prompted for the location of the Imperative CLI Framework package, which is located in the `node_modules/@zowe` folder in the directory where Zowe CLI was installed.
**Note:** When you update `package.json` to include new dependencies, or when you pull changes that affect `package.json`, issue the `npm update` command to download the dependencies.
3. To install the plugin, issue the following command:
3. To install the plug-in, issue the following command:
```
npm run installPlugin
```
The plugin should now be installed.
The plug-in should now be installed.
## Install the z/OS FTP Plug-in
Expand Down Expand Up @@ -83,13 +81,13 @@ Before you install the plug-in, meet the following requirements:
_____ Validation results for plugin '@zowe/zos-ftp-for-zowe-cli' _____
This plugin was successfully validated. Enjoy the plugin.
```
**Tip:** When an unsuccessful message displays, you can troubleshoot the installation by addressing the issues that the message describes. You can also review the information that is contained in the log file that is located in the directory where you installed Zowe CLI.
**Note:** When an unsuccessful message displays, you can troubleshoot the installation by addressing the issues that the message describes. For more details, you can review the logs located in the directory where you installed the Zowe CLI.
5. [Create a user profile](#create-a-user-profile).
## Creating a user profile
After you install the plug-in, you create an FTP profile. An FTP profile is recommended to issue commands to via FTP. FTP profiles contain your host, port, user name, and password for connect to z/OS using FTP. You can create multiple profiles and switch between them as needed.
After you install the plug-in, create an FTP profile. An FTP profile is recommended to issue commands to via FTP. FTP profiles contain your host, port, user name, and password for connect to z/OS using FTP. You can create multiple profiles and switch between them as needed.
**Follow these steps:**
1. Install the z/OS FTP Plug-in for Zowe CLI
Expand All @@ -111,21 +109,28 @@ After you install the plug-in, you create an FTP profile. An FTP profile is reco
## Running tests
You can perform the following types of tests on the z/OS FTP Plugin:
You can perform the following types of tests on the z/OS FTP plug-in:
- Unit
- System
**Note:** For detailed information about conventions and best practices for running tests against Zowe CLI plug-ins, see [Zowe CLI Plug-in Testing Guidelines](https://github.com/zowe/zowe-cli/blob/master/docs/PluginTESTINGGuidelines.md).
To define access credentials to the server, copy the file named `.../__tests__/__resources__/properties/example_properties.yaml` and create a file named `.../__tests__/__resources__/properties/custom_properties.yaml`.
To define access credentials to the server, copy the file named `.../__tests__/__resources__/properties/example_properties.yaml` and rename it `custom_properties.yaml`. This file contains details on how to specify connection information and credentials.
For the z/OS LPAR where the system test will be run for the first time, issue the following command to prepare the required data set:
```
zowe zos-ftp upload file-to-data-set "$localfile" "$data-set" `
```
For the z/OS LPAR where the system test will be ran for the first time, run the following command to prepare the required dataset:
- `$localfile`:
`zowe zos-ftp upload file-to-data-set "$localfile" "$dataset" `
Specifies an IEFBR14 job located in `__tests__/__resources__/IEFBR14.JCL`
where `$localfile` is an IEFBR14 JCL which is in `__tests__/__resources__/IEFBR14.JCL`, and `$dataset` is iefbr14Member which specified in custom_properties.yaml.
- `$data-set`:
Specifies an IEFBR14 data set determined by the iefbr14Member option in `custom_properties.yaml`
**Note:** Information about how to customize the `custom_properties.yaml` file is provided in the yaml file itself.
Expand All @@ -136,14 +141,14 @@ Issue the following commands to run the tests:
Any failures potentially indicate an issue with the set-up of the Rest API or configuration parameters that were passed in the `custom_properties.yaml` file.
## Uninstall the Plug-in
## Uninstall the plug-in
**Follow these steps:**
1. To uninstall the plug-in from a base application, issue the following command:
```
zowe plugins uninstall @zowe/zos-ftp-for-zowe-cli
```
After the uninstallation process completes successfully, the product no longer contains the plug-in configuration.
After the uninstallation process completes successfully, the Zowe CLI no longer contains the plug-in configuration.
## Contributing
Expand All @@ -157,13 +162,14 @@ To learn about building new commands or a new plug-in for Zowe CLI, see [Develop
[Imperative CLI Framework](https://github.com/zowe/imperative/wiki) documentation is a key source of information to learn about the features of Imperative CLI Framework (the code framework that you use to build plug-ins for Zowe CLI). Refer to the documentation as you develop your plug-in.
### Example usage
### Usage
Here is a script showing how you can submit JCL and download spool files via FTP remotely.
The following script demonstrates how you can use the FTP plug-in to submit a job and download its contents.
```bash
#!/bin/bash
# Submit the JCL contents from a local file and retrieve the ID of the job
jobid=$(zowe zos-ftp submit local-file IEFBR14.jcl --rff jobid --rft string)
if [ ! "$jobid" ];then
echo "Failed to submit job."
Expand All @@ -172,7 +178,7 @@ fi
echo "Submitted our job, JOB ID is $jobid"
#wait for it to go to output
# Wait for the job to complete by checking for the status to be OUTPUT
status="UNKNOWN"
while [[ "$status" != "OUTPUT" ]]; do
echo "Checking status of job $jobid"
Expand All @@ -183,6 +189,7 @@ done;
echo "Job is in output status. Downloading output..."
# Download the spool files to the `job_output` directory
zowe zos-ftp download all-spool-by-jobid "$jobid" --directory job_output --ojd
```
2 changes: 1 addition & 1 deletion src/api/CoreUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class CoreUtils {
});
}

public static async getProfileMeta(): Promise<ICommandProfileTypeConfiguration[]> {
public static async getProfileSchema(): Promise<ICommandProfileTypeConfiguration[]> {
const ftpProfile = await require("../imperative").profiles as ICommandProfileTypeConfiguration[];
return ftpProfile;
}
Expand Down

0 comments on commit e8096a8

Please sign in to comment.