@zowe/cli
Version:
Zowe CLI is a command line interface (CLI) that provides a simple and streamlined way to interact with IBM z/OS.
75 lines (74 loc) • 3.55 kB
TypeScript
import { AbstractSession } from "@zowe/imperative";
import { IZosFilesResponse } from "../../doc/IZosFilesResponse";
import { IDownloadOptions } from "./doc/IDownloadOptions";
/**
* This class holds helper functions that are used to download data sets, members and more through the z/OS MF APIs
*/
export declare class Download {
/**
* Retrieve data sets and/or members contents and save them in your local workspace
*
* @param {AbstractSession} session - z/OS MF connection info
* @param {string} dataSetName - contains the data set name
* @param {IDownloadOptions} [options={}] - contains the options to be sent
*
* @returns {Promise<IZosFilesResponse>} A response indicating the outcome of the API
*
* @throws {ImperativeError} data set name must be set
* @throws {Error} When the {@link ZosmfRestClient} throws an error
*
* @example
* ```typescript
*
* // Download "USER.DATA.SET.PS" to "user/data/set/ps.txt"
* await Download.dataSet(session, "USER.DATA.SET.PS");
*
* // Download "USER.DATA.SET.PDS(MEMBER)" to "user/data/set/pds/member.txt"
* await Download.dataSet(session, "USER.DATA.SET.PDS(MEMBER)");
*
* // Download "USER.DATA.SET" to "./path/to/file.txt"
* await Download.dataSet(session, "USER.DATA.SET", {file: "./path/to/file.txt"});
* ```
*
* @see https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.izua700/IZUHPINFO_API_GetReadDataSet.htm
*/
static dataSet(session: AbstractSession, dataSetName: string, options?: IDownloadOptions): Promise<IZosFilesResponse>;
/**
* Retrieve all members from a PDS and save them in your local workspace
*
* @param {AbstractSession} session - z/OS MF connection info
* @param {string} dataSetName - contains the data set name
* @param {IDownloadOptions} [options={}] - contains the options to be sent
*
* @returns {Promise<IZosFilesResponse>} A response indicating the outcome of the API
*
* @throws {ImperativeError} data set name must be set
* @throws {Error} When the {@link ZosmfRestClient} throws an error
*
* @example
* ```typescript
*
* // Download all members of "USER.DATA.SET.PDS" to "user/data/set/pds/"
* await Download.allMembers(session, "USER.DATA.SET.PDS");
*
* // Download all members of "USER.DATA.SET.PDS" to "./path/to/dir/"
* await Download.allMembers(session, "USER.DATA.SET.PDS", {directory: "./path/to/dir/"});
* ```
*
* @see https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.izua700/IZUHPINFO_API_GetReadDataSet.htm
*/
static allMembers(session: AbstractSession, dataSetName: string, options?: IDownloadOptions): Promise<IZosFilesResponse>;
/**
* Retrieve USS file content and save it in your local workspace.
*
* @param {AbstractSession} session - z/OS MF connection info
* @param {string} ussFileName - contains the USS file name
* @param {IDownloadOptions} [options={}] - contains the options to be sent
*
* @returns {Promise<IZosFilesResponse>} A response indicating the outcome of the API
*
* @throws {ImperativeError} USS file name must be set
* @throws {Error} When the {@link ZosmfRestClient} throws an error
*/
static ussFile(session: AbstractSession, ussFileName: string, options?: IDownloadOptions): Promise<IZosFilesResponse>;
}