# z/OS Console Package

Contains APIs to interact with the z/OS console (using z/OSMF console REST endpoints).

## API Examples

Submit a command to the z/OS console

    import { ProfileInfo } from "@zowe/imperative";
    import { IIssueParms, IssueCommand } from "@zowe/zos-console-for-zowe-sdk";

    (async () => {
        // Load connection info from default z/OSMF profile
        const profInfo = new ProfileInfo("zowe");
        await profInfo.readProfilesFromDisk();
        const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
        const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
        const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

        const parms: IIssueParms = {
            command: "D IPLINFO",
            sysplexSystem: undefined,
            solicitedKeyword: undefined,
            async: "N"
        };
        const response = await IssueCommand.issue(session, parms);
        console.log(response);
    })().catch((err) => {
        console.error(err);
        process.exit(1);
    });

#

Get the response from a command sent to the z/OS console

    import { ProfileInfo } from "@zowe/imperative";
    import { CollectCommand, ICollectParms } from "@zowe/zos-console-for-zowe-sdk";

    (async () => {
        // Load connection info from default z/OSMF profile
        const profInfo = new ProfileInfo("zowe");
        await profInfo.readProfilesFromDisk();
        const zosmfProfAttrs = profInfo.getDefaultProfile("zosmf");
        const zosmfMergedArgs = profInfo.mergeArgsForProfile(zosmfProfAttrs, { getSecureVals: true });
        const session = ProfileInfo.createSession(zosmfMergedArgs.knownArgs);

        const parms: ICollectParms = {
            commandResponseKey: "KEY",
            waitToCollect: undefined,
            followUpAttempts: undefined
        };
        const response = await CollectCommand.collect(session, parms);
        console.log(response);
    })().catch((err) => {
        console.error(err);
        process.exit(1);
    });

## Index

### Classes

- CollectCommand
- ConsoleConstants
- ConsoleResponseService
- ConsoleValidator
- IssueCommand

### Interfaces

- ICollectParms
- IConsoleParms
- IConsoleResponse
- IIssueParms
- IZosmfCollectResponse
- IZosmfIssueParms
- IZosmfIssueResponse

### Type aliases

- ConsoleResponse

### Object literals

- collectProcessingDetails
- decreaseCounter
- displayCollectError
- displayCollectResponse
- displayError
- displayResponse
- noCollectParameters
- noCommandKey
- noConsoleInput
- noConsoleName
- noZosmfInput
- resetCounter

## Type aliases

### ConsoleResponse

ConsoleResponse: (response: IConsoleResponse) => void

- Defined in @zowe/zos-console-for-zowe-sdk/src/types/ConsoleResponse.ts:14

#### Type declaration

- - (response: IConsoleResponse): void

  - #### Parameters

    - ##### response: IConsoleResponse

    #### Returns void

## Object literals

### Const collectProcessingDetails

collectProcessingDetails: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:57

### message

message: string = `Collect processing - timeout: {{timer}}, followUpCounter: {{counter}}`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:58

### Const decreaseCounter

decreaseCounter: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:36

### message

message: string = `Decreasing follow up counter`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:37

### Const displayCollectError

displayCollectError: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:33

### message

message: string = apiErrorHeader.message + ` Collect error: {{data}}`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:34

### Const displayCollectResponse

displayCollectResponse: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:30

### message

message: string = `Collect response: {{data}}`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:31

### Const displayError

displayError: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:27

### message

message: string = apiErrorHeader.message + ` Populating console error: {{data}}`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:28

### Const displayResponse

displayResponse: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:24

### message

message: string = `Populating console response: {{data}}`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:25

### Const noCollectParameters

noCollectParameters: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:54

### message

message: string = apiErrorHeader.message + ` No console collect parameters were supplied.`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:55

### Const noCommandKey

noCommandKey: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:51

### message

message: string = apiErrorHeader.message + ` No command response key was supplied.`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:52

### Const noConsoleInput

noConsoleInput: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:45

### message

message: string = apiErrorHeader.message + ` No console issue parameters were supplied.`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:46

### Const noConsoleName

noConsoleName: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:48

### message

message: string = apiErrorHeader.message + ` No console name was supplied.`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:49

### Const noZosmfInput

noZosmfInput: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:42

### message

message: string = apiErrorHeader.message + ` No zosmf console input parameters were supplied.`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:43

### Const resetCounter

resetCounter: object

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:39

### message

message: string = `Reset follow up counter`

- Defined in @zowe/zos-console-for-zowe-sdk/src/ConsoleConstants.ts:40

Generated using TypeDoc