@zowe/zosmf-for-zowe-sdk
Version:
Zowe SDK to interact with the z/OS Management Facility
49 lines • 2.49 kB
JavaScript
;
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ListDefinedSystems = void 0;
const imperative_1 = require("@zowe/imperative");
const path_1 = require("path");
const Zosmf_constants_1 = require("./constants/Zosmf.constants");
const Zosmf_messages_1 = require("./constants/Zosmf.messages");
const core_for_zowe_sdk_1 = require("@zowe/core-for-zowe-sdk");
/**
* This class is used to list the systems defined to z/OSMF throgh the
* z/OSMF APIs.
*/
class ListDefinedSystems {
/**
* List systems defined to z/OSMF
* @param {AbstractSession} session z/OSMF connection info.
* @returns {promise<IZosmfListDefinedSystemsResponse>} A response contains information from API call.
* @throws {ImperativeError} session must not be null or undefined. Any error threw by
* the REST API call.
*/
static listDefinedSystems(session) {
return __awaiter(this, void 0, void 0, function* () {
const endpoint = path_1.posix.join(Zosmf_constants_1.ZosmfConstants.RESOURCE, Zosmf_constants_1.ZosmfConstants.TOPOLOGY, Zosmf_constants_1.ZosmfConstants.SYSTEMS);
imperative_1.ImperativeExpect.toNotBeNullOrUndefined(session, Zosmf_messages_1.ZosmfMessages.missingSession.message);
return core_for_zowe_sdk_1.ZosmfRestClient.getExpectJSON(session, endpoint);
});
}
}
exports.ListDefinedSystems = ListDefinedSystems;
//# sourceMappingURL=ListDefinedSystems.js.map