Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @zowe/zosmf-for-zowe-sdk

z/OS Management Facility Package

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

API Examples

Check z/OSMF status

import { ProfileInfo } from "@zowe/imperative";
import { CheckStatus } from "@zowe/zosmf-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 response = await CheckStatus.getZosmfInfo(session);
    console.log(response);
})().catch((err) => {
    console.error(err);
    process.exit(1);
});

List systems defined to z/OSMF

import { ProfileInfo } from "@zowe/imperative";
import { ListDefinedSystems } from "@zowe/zosmf-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 response = await ListDefinedSystems.listDefinedSystems(session);
    console.log(response);
})().catch((err) => {
    console.error(err);
    process.exit(1);
});

Index

Object literals

Const ZosFilesOptions

ZosFilesOptions: object

Object containing all options to be used by the Download data set API

responseTimeout

responseTimeout: object

The files timeout header value

aliases

aliases: string[] = ["rto"]

defaultValue

defaultValue: undefined = undefined

description

description: string = "The maximum amount of time in seconds the z/OSMF Files TSO servlet should run before returning a response." +" Any request exceeding this amount of time will be terminated and return an error. Allowed values: 5 - 600"

name

name: string = "response-timeout"

numericValueRange

numericValueRange: number[] = [5, 600]

type

type: string = "number"

Const ZosmfConstants

ZosmfConstants: object

Constants to be used by the z/OSMF API

INFO

INFO: string = "/info"

indicator for get info request

RESOURCE

RESOURCE: string = "/zosmf"

Specifies the z/OS data set and file REST interface

SYSTEMS

SYSTEMS: string = "/systems"

indicator for get defined systems in zosmf

TOPOLOGY

TOPOLOGY: string = "/resttopology"

indicator for get topology services

ERROR_CODES

ERROR_CODES: object

Known error codes return by the API

BAD_HOST_NAME

BAD_HOST_NAME: string = "ENOTFOUND"

Error code when unable to connect to host

BAD_PORT

BAD_PORT: string = "ECONNREFUSED"

Error code when unable to connect to port

SELF_SIGNED_CERT_IN_CHAIN

SELF_SIGNED_CERT_IN_CHAIN: string = "SELF_SIGNED_CERT_IN_CHAIN"

Error code when self signed certificate in chain

UNABLE_TO_VERIFY_LEAF_SIGNATURE

UNABLE_TO_VERIFY_LEAF_SIGNATURE: string = "UNABLE_TO_VERIFY_LEAF_SIGNATURE"

Error code when unable to verify the first certificate

Const ZosmfMessages

ZosmfMessages: object

Messages to be used as detail display error message when gathering z/OSMF information

improperRejectUnauthorized

improperRejectUnauthorized: object

Message indicate that the rejectUnauthorized flag was not set properly

message

message: string = "A self-signed certificate was used ({{causeMsg}}),and your reject-unauthorized option is '{{rejectUnauthorized}}'."

invalidHostName

invalidHostName: object

Message indicate that unable to connect to specified host name

message

message: string = "Unable to establish connection to host "

invalidPort

invalidPort: object

Message indicate that unable to establish connection with specified port number

message

message: string = "Unable to establish connection at port "

missingSession

missingSession: object

Message indicate that input session object is invalid

message

message: string = "Missing profile session information."

Const ZosmfProfile

ZosmfProfile: object

Profile configuration for ZOSMF profiles

memberof

ZosmfProfile

createProfileExamples

createProfileExamples: { description: string; options: string }[] = [{options: "zos123 --host zos123 --port 1443 --user ibmuser --password myp4ss",description: "Create a zosmf profile called 'zos123' to connect to z/OSMF at host zos123 and port 1443"},{options: "zos124 --host zos124 --user ibmuser --password myp4ss --reject-unauthorized false",description: "Create a zosmf profile called 'zos124' to connect to z/OSMF at the host zos124 (default port - 443) " +"and allow self-signed certificates"},{options: "zos125 --host zos125 --port 1443",description: "Create a zosmf profile called 'zos125' to connect to z/OSMF at the host zos125 and port 1443, " +" not specifying a username or password so they are not stored on disk; these will need to be specified on every command"},{options: "zos126 --reject-unauthorized false",description: "Create a zosmf profile called 'zos126' to connect to z/OSMF on the default port 443 and allow self-signed " +"certificates, not specifying a username, password, or host so they are not stored on disk; these will need to be " +"specified on every command"},{options: "zosAPIML --host zosAPIML --port 7554 --user ibmuser --password myp4ss --reject-unauthorized false --base-path ibmzosmf/api/v1",description: "Create a zosmf profile called 'zosAPIML' to connect to z/OSMF via the Zowe API Mediation Layer running at host " +"'zosAPIML', port '7554', and allow for self-signed certificates. To reduce duplication, you could elect to store the 'host', " +"'port', 'reject-unauthorized', 'user', and 'password' values for the API Mediation Layer in a base profile and only store " +"the 'base-path' of the service in the zosmf profile"}]

type

type: string = "zosmf"

updateProfileExamples

updateProfileExamples: { description: string; options: string }[] = [{options: "zos123 --user newuser --password newp4ss",description: "Update a zosmf profile named 'zos123' with a new username and password"}]

schema

schema: object

description

description: string = "z/OSMF Profile"

required

required: undefined[] = []

title

title: string = "z/OSMF Profile"

type

type: string = "object"

properties

properties: object

basePath

basePath: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_BASE_PATH

type

type: string = "string"

certFile

certFile: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_CERT_FILE

type

type: string = "string"

certKeyFile

certKeyFile: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_CERT_KEY_FILE

type

type: string = "string"

encoding

encoding: object

type

type: string = "string"

optionDefinition

optionDefinition: object

aliases

aliases: string[] = ["ec"]

description

description: string = "The encoding for download and upload of z/OS data set and USS files." +" The default encoding if not specified is IBM-1047."

name

name: string = "encoding"

type

type: string = "string"

host

host: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_HOST

type

type: string = "string"

password

password: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_PASSWORD

secure

secure: boolean = true

type

type: string = "string"

port

port: object

includeInTemplate

includeInTemplate: boolean = true

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_PORT

type

type: string = "number"

protocol

protocol: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_PROTOCOL

type

type: string = "string"

rejectUnauthorized

rejectUnauthorized: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_REJECT_UNAUTHORIZED

type

type: string = "boolean"

responseTimeout

responseTimeout: object

optionDefinition

optionDefinition: any = ZosFilesOptions.responseTimeout

type

type: string = "number"

user

user: object

optionDefinition

optionDefinition: any = ZosmfSession.ZOSMF_OPTION_USER

secure

secure: boolean = true

type

type: string = "string"

Generated using TypeDoc