diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 2c571c6f39..2cada23679 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -2,9 +2,13 @@ All notable changes to the Zowe CLI package will be documented in this file. +## Recent Changes + +- Enhancement: Added support for running applications on TSO/E address spaces. Applications can be started, receive messages and transmit messages [#2280](https://github.com/zowe/zowe-cli/pull/2280) + ## `8.4.0` -- Enhancement: Added optional `--attributes` flag to `zowe zos-files upload file-to-uss` to allow passing a .zosattributes file path for upload encoding format. [#2319] (https://github.com/zowe/zowe-cli/pull/2319) +- Enhancement: Added optional `--attributes` flag to `zowe zos-files upload file-to-uss` to allow passing a .zosattributes file path for upload encoding format. [#2319](https://github.com/zowe/zowe-cli/pull/2319) ## `8.3.0` diff --git a/packages/cli/src/zosfiles/download/uss/UssFile.definition.ts b/packages/cli/src/zosfiles/download/uss/UssFile.definition.ts index 80c5852a33..e06e1af84f 100644 --- a/packages/cli/src/zosfiles/download/uss/UssFile.definition.ts +++ b/packages/cli/src/zosfiles/download/uss/UssFile.definition.ts @@ -39,6 +39,7 @@ export const UssFileDefinition: ICommandDefinition = { } ], options: [ + DownloadOptions.attributes, DownloadOptions.file, DownloadOptions.binary, DownloadOptions.encoding diff --git a/packages/cli/src/zosfiles/download/uss/UssFile.handler.ts b/packages/cli/src/zosfiles/download/uss/UssFile.handler.ts index c62fb8ee3d..8ffabe2469 100644 --- a/packages/cli/src/zosfiles/download/uss/UssFile.handler.ts +++ b/packages/cli/src/zosfiles/download/uss/UssFile.handler.ts @@ -11,7 +11,8 @@ import { ZosFilesBaseHandler } from "../../ZosFilesBase.handler"; import { AbstractSession, IHandlerParameters, ITaskWithStatus, TaskStage } from "@zowe/imperative"; -import { Download, IZosFilesResponse } from "@zowe/zos-files-for-zowe-sdk"; +import { Download, IDownloadOptions, IZosFilesResponse, ZosFilesAttributes } from "@zowe/zos-files-for-zowe-sdk"; +import { UploadOptions } from "../../upload/Upload.options"; /** * Handler to download an uss file @@ -25,13 +26,21 @@ export default class UssFileHandler extends ZosFilesBaseHandler { stageName: TaskStage.IN_PROGRESS }; commandParameters.response.progress.startBar({task}); - return Download.ussFile(session, commandParameters.arguments.ussFileName, { + + const downloadOptions: IDownloadOptions = { binary: commandParameters.arguments.binary, encoding: commandParameters.arguments.encoding, file: commandParameters.arguments.file, task, responseTimeout: commandParameters.arguments.responseTimeout, - overwrite: commandParameters.arguments.overwrite - }); + overwrite: commandParameters.arguments.overwrite, + }; + const attributes = ZosFilesAttributes.loadFromFile( + commandParameters.arguments.attributes, + ); + if (attributes != null) { + downloadOptions.attributes = attributes; + } + return Download.ussFile(session, commandParameters.arguments.ussFileName, downloadOptions); } } diff --git a/packages/zosfiles/src/doc/IOptions.ts b/packages/zosfiles/src/doc/IOptions.ts index d3509356c7..698a030453 100644 --- a/packages/zosfiles/src/doc/IOptions.ts +++ b/packages/zosfiles/src/doc/IOptions.ts @@ -11,6 +11,7 @@ import { ITaskWithStatus } from "@zowe/imperative"; import { IZosFilesOptions } from "./IZosFilesOptions"; +import { ZosFilesAttributes } from "../utils/ZosFilesAttributes"; /** * This interface defines the options that can be sent to get a data set or USS file function @@ -57,4 +58,8 @@ export interface IOptions extends IZosFilesOptions { * @type {ITaskWithStatus} */ task?: ITaskWithStatus; + /** + * The path to a .zosattributes file used to control file conversion and tagging. + */ + attributes?: ZosFilesAttributes; } diff --git a/packages/zosfiles/src/methods/download/Download.ts b/packages/zosfiles/src/methods/download/Download.ts index 5944f6b6ee..bb26072406 100644 --- a/packages/zosfiles/src/methods/download/Download.ts +++ b/packages/zosfiles/src/methods/download/Download.ts @@ -531,6 +531,8 @@ export class Download { ussFileName = ZosFilesUtils.sanitizeUssPathForRestCall(ussFileName); const endpoint = posix.join(ZosFilesConstants.RESOURCE, ZosFilesConstants.RES_USS_FILES, ussFileName); + options.encoding = options.attributes.getRemoteEncoding(ussFileName) + const reqHeaders: IHeaderContent[] = this.generateHeadersBasedOnOptions(options); // Use specific options to mimic ZosmfRestClient.getStreamed() diff --git a/packages/zosfiles/src/methods/download/doc/IDownloadOptions.ts b/packages/zosfiles/src/methods/download/doc/IDownloadOptions.ts index 103c496d2b..076d7a5522 100644 --- a/packages/zosfiles/src/methods/download/doc/IDownloadOptions.ts +++ b/packages/zosfiles/src/methods/download/doc/IDownloadOptions.ts @@ -58,9 +58,13 @@ export interface IDownloadSingleOptions extends IGetOptions { overwrite?: boolean; /** - * Optional stream to read the file contents + * Optional stream to write the file contents */ stream?: Writable; + /** + * The ZosFilesAttributes instance describe upload attributes for the files and directories + */ + attributes?: ZosFilesAttributes; } /** diff --git a/usstest.txt b/usstest.txt new file mode 100644 index 0000000000..e69de29bb2