UNPKG

@broadcom/ops-for-zowe-cli

Version:

OPS/MVS® Plug-in for Zowe CLI

180 lines 7.08 kB
"use strict"; /* * Copyright (c) 2025 Broadcom. All Rights Reserved. The term * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This software and all information contained therein is * confidential and proprietary and shall not be duplicated, * used, disclosed, or disseminated in any way except as * authorized by the applicable license agreement, without the * express written permission of Broadcom. All authorized * reproductions must be marked with this language. * * EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO * THE EXTENT PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS * SOFTWARE WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT * LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL BROADCOM * BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR * DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE, * INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS * INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF BROADCOM IS * EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE. */ 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.showRecords = exports.showSSMParms = exports.showTable = exports.showSubsystem = exports.showLogname = exports.showStatus = exports.showRuleset = exports.showResource = exports.showRule = void 0; const utils_1 = require("./utils"); const constants_1 = require("./constants"); const OpsRestClient_1 = require("./utils/OpsRestClient"); /** * returns data for specified rule * * @export * @param {Session} session * @param {string} ruleSetName * @param {string} ruleName * @param {boolean} restApi * @param {string} subSystem * @return {*} {Promise<IShowRuleResponse>} */ function showRule(session, ruleSetName, ruleName, restApi, subSystem) { return __awaiter(this, void 0, void 0, function* () { const ruleUrl = utils_1.RuleUtils.getRuleURL(session, ruleSetName, ruleName, restApi, subSystem); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, ruleUrl, constants_1.OpsConstants.headers); }); } exports.showRule = showRule; /** * returns data for specified resource * * @export * @param {Session} session * @param {string} resourceName * @param {boolean} restApi * @param {string} table * @param {string} subsystem * @return {*} {Promise<IShowResourceResponse>} */ function showResource(session, resourceName, restApi, table, subsystem) { return __awaiter(this, void 0, void 0, function* () { const resourceUrl = utils_1.SSMResourceUtils.getResourceURL(session, resourceName, restApi, table, subsystem); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, resourceUrl, constants_1.OpsConstants.headers); }); } exports.showResource = showResource; /** * returns ruleset data * * @export * @param {Session} session * @param {{ ruleSetName: string, subSystem: string }} body * @return {*} {Promise<IShowRulesetResponse>} */ function showRuleset(session, body) { return __awaiter(this, void 0, void 0, function* () { const rulesetUrl = utils_1.RulesetUtils.getRulesetURL(session, body.ruleSetName, body.subSystem); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, rulesetUrl, constants_1.OpsConstants.headers); }); } exports.showRuleset = showRuleset; /** * returns system status * * @export * @param {Session} session * @return {*} {Promise<IShowStatusResponse>} */ function showStatus(session) { return __awaiter(this, void 0, void 0, function* () { const statusUrl = utils_1.StatusUtils.getStatusURL(session); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, statusUrl, constants_1.OpsConstants.headers); }); } exports.showStatus = showStatus; /** * returns list of opslog names * * @export * @param {Session} session * @param {string} subSystem * @return {*} {Promise<IShowLognameResponse>} */ function showLogname(session, subSystem) { return __awaiter(this, void 0, void 0, function* () { const logUrl = utils_1.LognameUtils.getLogURL(session, subSystem); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, logUrl, constants_1.OpsConstants.headers); }); } exports.showLogname = showLogname; /** * returns list of subsytems * * @export * @param {Session} session * @return {*} {Promise<IShowSubsystemResponse>} */ function showSubsystem(session) { return __awaiter(this, void 0, void 0, function* () { const subsystemsURL = utils_1.SubsystemsUtils.getSubsystemsURL(session); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, subsystemsURL, constants_1.OpsConstants.headers); }); } exports.showSubsystem = showSubsystem; /** * returns a list of rdf tables that match request * * @export * @param {Session} session * @param {string} subSystem * @param {string} table * @param {IHandlerParameters} params * @return {*} {Promise<IShowLognameResponse>} */ function showTable(session, body) { return __awaiter(this, void 0, void 0, function* () { const tableUrl = utils_1.TableUtils.getTableURL(session, body); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, tableUrl, constants_1.OpsConstants.headers); }); } exports.showTable = showTable; /** * returns a list of SSM parms * * @export * @param {Session} session * @param {string} subSystem * @return {*} {Promise<IShowLognameResponse>} */ function showSSMParms(session, subSystem) { return __awaiter(this, void 0, void 0, function* () { const parmsUrl = utils_1.ParmsUtils.getParmsURL(session, subSystem); return OpsRestClient_1.OpsRestClient.getExpectJSON(session, parmsUrl, constants_1.OpsConstants.headers); }); } exports.showSSMParms = showSSMParms; /** * returns a list of OPSLOG records * * @export * @param {Session} session * @param {IShowRecordsCommandBody} body * @param {string} subSystem * @return {*} {Promise<IShowRecordsResponse>} */ function showRecords(session, body, subSystem) { return __awaiter(this, void 0, void 0, function* () { const recordsUrl = utils_1.RecordsUtils.getRecordsURL(session, body, subSystem); return OpsRestClient_1.OpsRestClient.postExpectJSON(session, recordsUrl, constants_1.OpsConstants.headers); }); } exports.showRecords = showRecords; //# sourceMappingURL=Show.js.map