This class holds helper functions that are used to download data sets, members and more through the z/OS MF APIs

### Hierarchy

- Download

## Index

### Methods

- allDataSets
- allMembers
- buildDownloadDsmResponse
- buildDownloadUssDirResponse
- dataSet
- emptyDownloadDsmResult
- emptyDownloadUssDirResult
- generateHeadersBasedOnOptions
- parseAttributeOptions
- ussDir
- ussFile

## Methods

### Static allDataSets

- allDataSets(session: AbstractSession, dataSetObjs: IZosmfListResponse[], options?: IDownloadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:417

  Download a list of data sets to local files

  throws

    {ImperativeError} data set name must be set

  throws

    {Error} When the ZosmfRestClient throws an error

  example

        // Download a list of "PS" and "PO" datasets to the directory "./path/to/dir/"
        await Download.allDataSets(session, [
           { dsname: "USER.DATA.SET.PS", dsorg: "PS" },
           { dsname: "USER.DATA.SET.PDS", dsorg: "PO" }
        ], {directory: "./path/to/dir/"});

  see

    https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.izua700/IZUHPINFO_API_GetReadDataSet.htm

  #### Parameters

  - ##### session: AbstractSession

    z/OS MF connection info

  - ##### dataSetObjs: IZosmfListResponse[]

    contains data set objects returned by z/OSMF List API

  - ##### Default value options: IDownloadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the outcome of the API

### Static allMembers

- allMembers(session: AbstractSession, dataSetName: string, options?: IDownloadOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:227

  Retrieve all members from a PDS and save them in your local workspace

  throws

    {ImperativeError} data set name must be set

  throws

    {Error} When the ZosmfRestClient throws an error

  example

        // 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

  #### Parameters

  - ##### session: AbstractSession

    z/OS MF connection info

  - ##### dataSetName: string

    contains the data set name

  - ##### Default value options: IDownloadOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the outcome of the API

### Static Private buildDownloadDsmResponse

- buildDownloadDsmResponse(result: IDownloadDsmResult, options?: IDownloadOptions): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:872

  Build a response string from a download data sets matching result.

  #### Parameters

  - ##### result: IDownloadDsmResult

    Result object from the download API

  - ##### Default value options: IDownloadOptions = {}

    Options passed to the download API

  #### Returns string

  Response string to print to console

### Static Private buildDownloadUssDirResponse

- buildDownloadUssDirResponse(result: IDownloadUssDirResult, options?: IDownloadOptions): string

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:932

  Build a response string from a download ussDir result.

  #### Parameters

  - ##### result: IDownloadUssDirResult

    Result object from the download API

  - ##### Default value options: IDownloadOptions = {}

    Options passed to the download API

  #### Returns string

  Response string to print to console

### Static dataSet

- dataSet(session: AbstractSession, dataSetName: string, options?: IDownloadSingleOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:81

  Retrieve data sets and/or members contents and save them in your local workspace

  throws

    {ImperativeError} data set name must be set

  throws

    {Error} When the ZosmfRestClient throws an error

  example

        // 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

  #### Parameters

  - ##### session: AbstractSession

    z/OS MF connection info

  - ##### dataSetName: string

    contains the data set name

  - ##### Default value options: IDownloadSingleOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the outcome of the API

### Static Private emptyDownloadDsmResult

- emptyDownloadDsmResult(): IDownloadDsmResult

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:845

  Create an empty download data sets matching result.

  #### Returns IDownloadDsmResult

  Results object with all lists initialized as empty

### Static Private emptyDownloadUssDirResult

- emptyDownloadUssDirResult(): IDownloadUssDirResult

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:858

  Create an empty download data sets matching result.

  #### Returns IDownloadUssDirResult

  Results object with all lists initialized as empty

### Static Private generateHeadersBasedOnOptions

- generateHeadersBasedOnOptions(options: IDownloadOptions): any[]

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:970

  #### Parameters

  - ##### options: IDownloadOptions

  #### Returns any[]

### Static Private parseAttributeOptions

- parseAttributeOptions(filename: string, options: IDownloadOptions): Partial<IDownloadOptions>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:982

  #### Parameters

  - ##### filename: string

  - ##### options: IDownloadOptions

  #### Returns Partial<IDownloadOptions>

### Static ussDir

- ussDir(session: AbstractSession, ussDirName: string, fileOptions?: IDownloadOptions, listOptions?: IUSSListOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:716

  Retrieve USS file content and save it in your local workspace.

  throws

    {ImperativeError} USS file name must be set

  throws

    {Error} When the ZosmfRestClient throws an error

  #### Parameters

  - ##### session: AbstractSession

    z/OS MF connection info

  - ##### ussDirName: string

    contains the USS file name

  - ##### Default value fileOptions: IDownloadOptions = {}

  - ##### Default value listOptions: IUSSListOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the outcome of the API

### Static ussFile

- ussFile(session: AbstractSession, ussFileName: string, options?: IDownloadSingleOptions): Promise<IZosFilesResponse>

- - Defined in @zowe/zos-files-for-zowe-sdk/src/methods/download/Download.ts:618

  Retrieve USS file content and save it in your local workspace.

  throws

    {ImperativeError} USS file name must be set

  throws

    {Error} When the ZosmfRestClient throws an error

  #### Parameters

  - ##### session: AbstractSession

    z/OS MF connection info

  - ##### ussFileName: string

    contains the USS file name

  - ##### Default value options: IDownloadSingleOptions = {}

  #### Returns Promise<IZosFilesResponse>

  A response indicating the outcome of the API

Generated using TypeDoc