@zowe/cics-for-zowe-cli
Version:
IBM CICS Plug-in for Zowe CLI
46 lines • 1.72 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.
*
*/
Object.defineProperty(exports, "__esModule", { value: true });
const cics_for_zowe_sdk_1 = require("@zowe/cics-for-zowe-sdk");
const imperative_1 = require("@zowe/imperative");
const CicsBaseHandler_1 = require("../../CicsBaseHandler");
/**
* Command handler for defining CICS programs via CMCI
* @export
* @class ProgramHandler
* @implements {ICommandHandler}
*/
class ResourceHandler extends CicsBaseHandler_1.CicsBaseHandler {
async processWithSession(params, session) {
const status = {
statusMessage: "Getting resources from CICS",
percentComplete: 0,
stageName: imperative_1.TaskStage.IN_PROGRESS,
};
params.response.progress.startBar({ task: status });
const response = await (0, cics_for_zowe_sdk_1.getResource)(session, {
name: params.arguments.resourceName,
regionName: params.arguments.regionName,
cicsPlex: params.arguments.cicsPlex,
criteria: params.arguments.criteria,
parameter: params.arguments.parameter,
});
params.response.format.output({
fields: [],
format: "object",
output: response.response.records[params.arguments.resourceName.toLowerCase()],
});
return response;
}
}
exports.default = ResourceHandler;
//# sourceMappingURL=Resource.handler.js.map