@zowe/cics-for-zowe-sdk
Version:
Zowe SDK for IBM CICS Transaction Server
42 lines • 2.28 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 });
exports.removeCSDGroupFromList = void 0;
const imperative_1 = require("@zowe/imperative");
const constants_1 = require("../../constants");
const rest_1 = require("../../rest");
const utils_1 = require("../../utils");
/**
* Remove a CSD Group resource from a CSD List in CICS through CMCI REST API
* @param {AbstractSession} session - the session to connect to CMCI with
* @param {ICSDGroupParms} parms - parameters for defining your CSD Group
* @returns {Promise<any>} promise that resolves to the response (XML parsed into a javascript object)
* when the request is complete
* @throws {ImperativeError} CICS CSD Group name not defined or blank
* @throws {ImperativeError} CICS CSD List not defined or blank
* @throws {ImperativeError} CicsCmciRestClient request fails
*/
function removeCSDGroupFromList(session, parms) {
imperative_1.ImperativeExpect.toBeDefinedAndNonBlank(parms.name, "CICS CSD Group Name", "CICS CSD Group Name is required");
imperative_1.ImperativeExpect.toBeDefinedAndNonBlank(parms.csdList, "CICS CSD List", "CICS CSD List is required");
imperative_1.ImperativeExpect.toBeDefinedAndNonBlank(parms.regionName, "CICS Region name", "CICS region name is required");
imperative_1.Logger.getAppLogger().debug("Attempting to remove a CSD Group from a CSD List with the following parameters:\n%s", JSON.stringify(parms));
const options = {
cicsPlex: parms.cicsPlex,
regionName: parms.regionName,
criteria: `(CSDLIST=='${parms.csdList}') AND (CSDGROUP=='${parms.name}')`,
};
const cmciResource = utils_1.Utils.getResourceUri(constants_1.CicsCmciConstants.CICS_CSDGROUP_IN_LIST, options);
return rest_1.CicsCmciRestClient.deleteExpectParsedXml(session, cmciResource, []);
}
exports.removeCSDGroupFromList = removeCSDGroupFromList;
//# sourceMappingURL=RemoveFromList.js.map