-
Notifications
You must be signed in to change notification settings - Fork 114
feat: Data set and USS download commands #3843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
716e1bc
72877ab
5bb37c1
08de650
ab2535a
f87c6b5
7a9b90f
42fcb20
c4eaeb4
7ea6ff2
8eafadb
d230ec0
116d596
2d2b5ac
fa100fb
5f81fc3
17fc579
a663383
9c6c4ed
4a039fc
ed79831
a003177
11beac6
5c15080
efb87ef
e8bce59
e25d90f
03fa91e
a3de6fd
cab987b
5da1f2a
9bf9a9d
10a1ce7
6f636e2
a61fa6f
a44a6ba
1b06aad
dfd1cef
a7dec25
e3485ec
8080e2d
75ac863
2e3b2c0
51fba05
942cd71
47a66ec
6054ce9
059aacf
901e89f
1e8b83d
a3df2f6
84d65f5
ae6089f
ecb2e62
0e135e1
7e0c72a
aab7bcf
8db110b
9b8fd1f
26a967c
ae2b9d1
04b3baa
4ca56ee
89c7029
5de74fa
c67ec82
a9b1673
cfe4d86
c01e313
e990225
73f266f
041e529
6911be0
bc2d665
1a9f3d8
43b43fb
514a78c
401be7d
2a6907f
e917cb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,7 @@ export namespace MainframeInteraction { | |
| * as well as the list of results in apiResponse.items with | ||
| * minimal properties name, mode. | ||
| */ | ||
| fileList(ussFilePath: string): Promise<zosfiles.IZosFilesResponse>; | ||
| fileList(ussFilePath: string, options?: zosfiles.IUSSListOptions): Promise<zosfiles.IZosFilesResponse>; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. brought up in another issue, with adding a new optional parameter should we create a new API and mark the other as deprecated?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm @JillieBeanSim I do not understand why this would be a breaking change or not backwards compatible, as I thought simply making a parameter optional is enough to get by. |
||
|
|
||
| /** | ||
| * Check th USS chtag to see if a file requires conversion. | ||
|
|
@@ -119,9 +119,24 @@ export namespace MainframeInteraction { | |
| * | ||
| * @param {string} ussFilePath | ||
| * @param {zosfiles.IDownloadOptions} options | ||
| * @returns {Promise<zosfiles.IZosFilesResponse>} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding the return value to the TSDoc. 🙏
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confused on this one. Which ones aren't returning the proper Promise<...> value? Thanks |
||
| */ | ||
| getContents(ussFilePath: string, options: zosfiles.IDownloadSingleOptions): Promise<zosfiles.IZosFilesResponse>; | ||
|
|
||
| /** | ||
| * Download a USS directory to the local file system. | ||
| * | ||
| * @param {string} ussDirectoryPath The path of the USS directory to download | ||
| * @param {zosfiles.IDownloadOptions} fileOptions Download options including local directory path | ||
| * @param {zosfiles.IUSSListOptions} listOptions Options for listing files in USS | ||
| * @returns {Promise<zosfiles.IZosFilesResponse>} | ||
| */ | ||
| downloadDirectory?( | ||
| ussDirectoryPath: string, | ||
| fileOptions?: zosfiles.IDownloadOptions, | ||
| listOptions?: zosfiles.IUSSListOptions | ||
| ): Promise<zosfiles.IZosFilesResponse>; | ||
|
|
||
| /** | ||
| * Uploads a given buffer as the contents of a file on USS. | ||
| * @param {Buffer} buffer | ||
|
|
@@ -235,6 +250,15 @@ export namespace MainframeInteraction { | |
| */ | ||
| getContents(dataSetName: string, options?: zosfiles.IDownloadSingleOptions): Promise<zosfiles.IZosFilesResponse>; | ||
|
|
||
| /** | ||
| * Retrieve all members of a partitioned data set and save them to a directory. | ||
| * | ||
| * @param {string} dataSetName | ||
| * @param {zosfiles.IDownloadOptions} [options] | ||
| * @returns {Promise<zosfiles.IZosFilesResponse>} | ||
| */ | ||
| downloadAllMembers?(dataSetName: string, options?: zosfiles.IDownloadOptions): Promise<zosfiles.IZosFilesResponse>; | ||
|
|
||
| /** | ||
| * Uploads a given buffer as the contents of a file to a data set or member. | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,8 +114,11 @@ import { IDataSetCount } from "../dataset/IDataSetCount"; | |
| * An implementation of the Zowe Explorer USS API interface for zOSMF. | ||
| */ | ||
| export class UssApi extends CommonApi implements MainframeInteraction.IUss { | ||
| public fileList(ussFilePath: string): Promise<zosfiles.IZosFilesResponse> { | ||
| return zosfiles.List.fileList(this.getSession(), ussFilePath, { responseTimeout: this.profile?.profile?.responseTimeout }); | ||
| public fileList(ussFilePath: string, options?: zosfiles.IUSSListOptions): Promise<zosfiles.IZosFilesResponse> { | ||
| return zosfiles.List.fileList(this.getSession(), ussFilePath, { | ||
| responseTimeout: this.profile?.profile?.responseTimeout, | ||
| ...options, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would we need to check for existence of options here to avoid issues like seen here or have a new API deprecating the old for adoption of new feature
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the case of the previous issue where the optional parameter was added, the mistake was that they were using it without checking if it was existent or not. In this case however, the |
||
| }); | ||
| } | ||
|
|
||
| public isFileTagBinOrAscii(ussFilePath: string): Promise<boolean> { | ||
|
|
@@ -129,6 +132,22 @@ import { IDataSetCount } from "../dataset/IDataSetCount"; | |
| }); | ||
| } | ||
|
|
||
| public downloadDirectory( | ||
| ussDirectoryPath: string, | ||
| fileOptions?: zosfiles.IDownloadOptions, | ||
| listOptions?: zosfiles.IUSSListOptions | ||
| ): Promise<zosfiles.IZosFilesResponse> { | ||
| return zosfiles.Download.ussDir( | ||
| this.getSession(), | ||
| ussDirectoryPath, | ||
| { | ||
| responseTimeout: this.profile?.profile?.responseTimeout, | ||
| ...fileOptions, | ||
| }, | ||
| listOptions | ||
| ); | ||
| } | ||
|
|
||
| public copy(outputPath: string, options?: Omit<object, "request">): Promise<Buffer> { | ||
| return zosfiles.Utilities.putUSSPayload(this.getSession(), outputPath, { ...options, request: "copy" }); | ||
| } | ||
|
|
@@ -260,6 +279,13 @@ import { IDataSetCount } from "../dataset/IDataSetCount"; | |
| }); | ||
| } | ||
|
|
||
| public downloadAllMembers(dataSetName: string, options?: zosfiles.IDownloadOptions): Promise<zosfiles.IZosFilesResponse> { | ||
| return zosfiles.Download.allMembers(this.getSession(), dataSetName, { | ||
| responseTimeout: this.profile?.profile?.responseTimeout, | ||
| ...options, | ||
| }); | ||
| } | ||
|
|
||
| public uploadFromBuffer(buffer: Buffer, dataSetName: string, options?: zosfiles.IUploadOptions): Promise<zosfiles.IZosFilesResponse> { | ||
| return zosfiles.Upload.bufferToDataSet(this.getSession(), buffer, dataSetName, { | ||
| responseTimeout: this.profile?.profile?.responseTimeout, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.