@broadcom/ops-for-zowe-cli
Version:
OPS/MVS® Plug-in for Zowe CLI
138 lines • 5.36 kB
JavaScript
;
/*
* Copyright (c) 2024 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpsRestUtils = void 0;
/**
* Class to hold APIs related to OPS/MVS Web Services / REST API
* @export
* @class OpsRestUtils
*/
class OpsRestUtils {
}
exports.OpsRestUtils = OpsRestUtils;
OpsRestUtils.APP_URL = "/opsmvs/api";
OpsRestUtils.VERSION = "v1";
// public static serviceID: string = "serviceId";
OpsRestUtils.BASE_URL = `${OpsRestUtils.APP_URL}/${OpsRestUtils.VERSION}`;
OpsRestUtils.AOF_URL = `${OpsRestUtils.BASE_URL}/aof`;
OpsRestUtils.OPS_CONNECTION_GROUP = "OPS/MVS Web Services / REST API connection options";
OpsRestUtils.HOST_OPTION = {
description: "The hostname of the server where OPS/MVS Web Services / REST API is running.",
type: "string",
name: "host",
required: false,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.PORT_OPTION = {
description: "The port number for OPS/MVS Web Services / REST API.",
type: "number",
name: "port", aliases: ["p"],
required: false,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.USER_OPTION = {
description: "Your z/OS user name that is used to authenticate to OPS/MVS Web Services / REST API.",
type: "string",
name: "user",
required: false,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.PASSWORD_OPTION = {
description: "Your z/OS password that is used to authenticate to OPS/MVS Web Services / REST API.",
type: "string",
name: "password", aliases: ["pass"],
required: false,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.PROTOCOL_OPTION = {
description: "The protocol that is used for connecting to OPS/MVS Web Services / REST API.",
type: "string",
name: "protocol", aliases: ["prot"],
defaultValue: "https",
allowableValues: {
values: ["http", "https"],
caseSensitive: false,
},
required: true,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.REJECT_UNAUTHORIZED_OPTION = {
description: "If set to true, the server certificate is verified against the list of supplied CAs. If " +
"set to false, certificate verification is not performed.",
type: "boolean",
name: "reject-unauthorized", aliases: ["ru"],
defaultValue: true,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.SUBSYSTEM_OPTION = {
description: "Specifies the subsystem ID of the OPS/MVS instance to which commands will be directed. " +
"This parameter is ignored by the 'show status' and 'show subsystem' commands.",
type: "string",
name: "subsystem", aliases: ["subs"],
defaultValue: "OPSS",
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.RESTAPI_OPTION = {
description: "If set to true, the plug-in executes the command against the OPS/MVS REST API. If " +
"set to false, the plug-in executes against the OPS/MVS Web Services.",
type: "boolean",
name: "rest-api", aliases: ["ra"],
defaultValue: false,
required: false,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.BASEPATH_OPTION = {
description: "NOTE: This parameter can only be used with the REST API server. " +
"Specifies the base path for your Zowe API Mediation Layer instance. Specify this option to " +
"prepend the base path to all resources when making REST requests. Only specify " +
"this option if you are using an Zowe API Mediation Layer.",
type: "string",
name: "base-path", aliases: ["bp"],
required: false,
group: OpsRestUtils.OPS_CONNECTION_GROUP
};
OpsRestUtils.OPS_CONNECTION_OPTIONS = [
OpsRestUtils.USER_OPTION,
OpsRestUtils.PASSWORD_OPTION,
OpsRestUtils.HOST_OPTION,
OpsRestUtils.PORT_OPTION,
OpsRestUtils.REJECT_UNAUTHORIZED_OPTION,
OpsRestUtils.PROTOCOL_OPTION,
OpsRestUtils.SUBSYSTEM_OPTION,
OpsRestUtils.RESTAPI_OPTION,
OpsRestUtils.BASEPATH_OPTION
];
/**
* Using the passOn feature of imperative, we can make all child commands
*
*/
OpsRestUtils.OPS_CONNECTION_PASS_ON = [{
ignoreNodes: [{
type: "group"
}],
property: "options",
value: OpsRestUtils.OPS_CONNECTION_OPTIONS,
merge: true
}];
//# sourceMappingURL=OpsRestUtils.js.map