Command response object built by the command processor (and command handler). The response object is always built internally, but displayed to the command issuer if response-format-json is specified.

For handlers, see the HandlerResponse (IHandlerResponseApi) for the public APIs used to by handlers to create this response.

export
interface

  ICommandResponse

### Hierarchy

- ICommandResponse

## Index

### Properties

- data
- error
- exitCode
- message
- stderr
- stdout
- success

## Properties

### Optional data

data: any

- Defined in @zowe/imperative/src/cmd/src/doc/response/response/ICommandResponse.ts:63

Handlers (and help, etc.) can choose to append a data object to the response. Not displayed to the console unless response format JSON is specified.

memberof

  ICommandResponse

### Optional error

error: IImperativeError

- Defined in @zowe/imperative/src/cmd/src/doc/response/response/ICommandResponse.ts:70

Error object automatically appended by the command processor when a handler rejects the promise. Contains the stack and other messages to help diagnosis. Not displayed to the console unless response format JSON is specified.

memberof

  ICommandResponse

### exitCode

exitCode: number

- Defined in @zowe/imperative/src/cmd/src/doc/response/response/ICommandResponse.ts:37

Requested exit code for the process when your command is complete. If this is not specified, the default is 0 for successful commands and 1 for failed commands according to the value of the above "success" field.

memberof

  ICommandResponse

### message

message: string

- Defined in @zowe/imperative/src/cmd/src/doc/response/response/ICommandResponse.ts:44

Message appended by the handlers. The message is not displayed on the console, only displayed if response format JSON is indicated.

memberof

  ICommandResponse

### Optional stderr

stderr: Buffer

- Defined in @zowe/imperative/src/cmd/src/doc/response/response/ICommandResponse.ts:56

The stderr from the command. Buffered regardless of response format specification.

memberof

  ICommandResponse

### Optional stdout

stdout: Buffer

- Defined in @zowe/imperative/src/cmd/src/doc/response/response/ICommandResponse.ts:50

The stdout from the command. Buffered regardless of response format specification.

memberof

  ICommandResponse

### success

success: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/response/response/ICommandResponse.ts:29

Overall command success flag. True indicates that the command handler/processor/help was successful.

memberof

  ICommandResponse

Generated using TypeDoc