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 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."

Generated using TypeDoc