vscode-extension-for-zowe
vscode-extension-for-zowe copied to clipboard
Could ZoweExplorerApi.IMvs also have "Get.dataSet()" ?
Hi,
The ZOSMF / Zowe "Get,dataSet()" function allowed the contents of a dataset to be downloaed to a buffer. It'd be great if we could do the same via the "ZoweExplorerApi.IMvs" interace / api.
Hi, I still am interested in a Get.dataset api, is there any way to get this added at some point in the future?
Hi,
Currently I use the Get.dataSet() api to "get the contents of a small dataset" as string. The data set contains UTF-8 test data.
async function getDataSetAsString(profile: IProfileLoaded, dsn: string): Promise<string> {
const session = await ZosmfSession.createBasicZosmfSession(profile.profile);
const response = await Get.dataSet(session, dsn, binary: true }));
return response.toString();
}
I use this API as a local temporary file is not required and does not have to be subsequently deleted.
Hi @travatine, we have the dataset function implemented as an API. Kindly check if this suits your needs and if we can close this issue. Thanks!
Hi,
I needed to download a file to a string, that API function uses a temporary file rather than a string.
Could a function to download a file to string please be added to the dataset API?
Thanks
Hi @travatine ! is the use case for this to enhance Zowe Explorer to be able to download a data set through a right-click for example or to have this call to get a dataset into our API?
If the case is the second one, I believe the following should fufill your need for downloading a file to a string in the dataset API:
public getContents(dataSetName: string, options?: zowe.IDownloadOptions): Promise<zowe.IZosFilesResponse> {
return zowe.Download.dataSet(this.getSession(), dataSetName, options);
}
Thank you for raising this issue. The community has 90 days to upvote 👍 the issue. If it receives 10 upvotes, we will move it to our backlog. If not, we will close it.
Thanks @rudyflores