@broadcom/ops-for-zowe-cli 4.1.1 → 5.0.0-next.202401221923

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +8 -12
  3. package/lib/api/OpsProfilesConfig.js +18 -14
  4. package/lib/api/OpsProfilesConfig.js.map +1 -1
  5. package/lib/api/Show.d.ts +6 -0
  6. package/lib/api/Show.js +67 -0
  7. package/lib/api/Show.js.map +1 -0
  8. package/lib/api/{methods/update/Update.d.ts → Update.d.ts} +2 -2
  9. package/lib/api/{methods/update/Update.js → Update.js} +46 -18
  10. package/lib/api/Update.js.map +1 -0
  11. package/lib/api/constants/Ops.constants.js +7 -5
  12. package/lib/api/constants/Ops.constants.js.map +1 -1
  13. package/lib/api/constants/PluginConstants.js +1 -1
  14. package/lib/api/constants/index.js +7 -3
  15. package/lib/api/constants/index.js.map +1 -1
  16. package/lib/api/doc/IShowResourceResponse.js +1 -1
  17. package/lib/api/doc/IShowRuleResponse.js +1 -1
  18. package/lib/api/doc/IShowRulesetResponse.d.ts +12 -0
  19. package/lib/api/{methods/update/index.js → doc/IShowRulesetResponse.js} +2 -13
  20. package/lib/api/doc/IShowRulesetResponse.js.map +1 -0
  21. package/lib/api/index.d.ts +4 -1
  22. package/lib/api/index.js +11 -4
  23. package/lib/api/index.js.map +1 -1
  24. package/lib/api/utils/IOpsRestResponse.js +1 -1
  25. package/lib/api/utils/OpsRestClient.d.ts +15 -0
  26. package/lib/api/utils/OpsRestClient.js +66 -0
  27. package/lib/api/utils/OpsRestClient.js.map +1 -0
  28. package/lib/api/utils/OpsRestUtils.d.ts +3 -2
  29. package/lib/api/utils/OpsRestUtils.js +20 -9
  30. package/lib/api/utils/OpsRestUtils.js.map +1 -1
  31. package/lib/api/utils/OpsTextUtils.js +14 -5
  32. package/lib/api/utils/OpsTextUtils.js.map +1 -1
  33. package/lib/api/utils/RuleListUtils.d.ts +1 -0
  34. package/lib/api/utils/RuleListUtils.js +36 -9
  35. package/lib/api/utils/RuleListUtils.js.map +1 -1
  36. package/lib/api/utils/RuleUtils.d.ts +4 -4
  37. package/lib/api/utils/RuleUtils.js +32 -16
  38. package/lib/api/utils/RuleUtils.js.map +1 -1
  39. package/lib/api/utils/RulesetListUtils.d.ts +4 -0
  40. package/lib/api/{methods/index.js → utils/RulesetListUtils.js} +18 -14
  41. package/lib/api/utils/RulesetListUtils.js.map +1 -0
  42. package/lib/api/utils/RulesetUtils.d.ts +5 -0
  43. package/lib/api/utils/RulesetUtils.js +51 -0
  44. package/lib/api/utils/RulesetUtils.js.map +1 -0
  45. package/lib/api/utils/SSMResourceListUtils.js +21 -5
  46. package/lib/api/utils/SSMResourceListUtils.js.map +1 -1
  47. package/lib/api/utils/SSMUtils.d.ts +5 -4
  48. package/lib/api/utils/SSMUtils.js +83 -23
  49. package/lib/api/utils/SSMUtils.js.map +1 -1
  50. package/lib/api/utils/index.d.ts +4 -2
  51. package/lib/api/utils/index.js +11 -5
  52. package/lib/api/utils/index.js.map +1 -1
  53. package/lib/cli/OpsBaseHandler.js +3 -3
  54. package/lib/cli/OpsBaseHandler.js.map +1 -1
  55. package/lib/cli/ResourceParameterDefinitions.d.ts +1 -1
  56. package/lib/cli/ResourceParameterDefinitions.js +12 -7
  57. package/lib/cli/ResourceParameterDefinitions.js.map +1 -1
  58. package/lib/cli/RuleParameterDefinitions.js +2 -2
  59. package/lib/cli/RuleParameterDefinitions.js.map +1 -1
  60. package/lib/cli/RulesetParameterDefinitions.d.ts +5 -0
  61. package/lib/{api/methods/show/index.js → cli/RulesetParameterDefinitions.js} +14 -13
  62. package/lib/cli/RulesetParameterDefinitions.js.map +1 -0
  63. package/lib/cli/disable/Disable.definition.js +5 -5
  64. package/lib/cli/disable/Disable.definition.js.map +1 -1
  65. package/lib/cli/disable/rule/Rule.definition.js +2 -2
  66. package/lib/cli/disable/rule/Rule.definition.js.map +1 -1
  67. package/lib/cli/disable/rule/Rule.handler.js +3 -3
  68. package/lib/cli/disable/rule/Rule.handler.js.map +1 -1
  69. package/lib/cli/enable/Enable.definition.js +5 -6
  70. package/lib/cli/enable/Enable.definition.js.map +1 -1
  71. package/lib/cli/enable/rule/Rule.definition.js +2 -2
  72. package/lib/cli/enable/rule/Rule.definition.js.map +1 -1
  73. package/lib/cli/enable/rule/Rule.handler.js +2 -2
  74. package/lib/cli/enable/rule/Rule.handler.js.map +1 -1
  75. package/lib/cli/show/Show.definition.js +7 -6
  76. package/lib/cli/show/Show.definition.js.map +1 -1
  77. package/lib/cli/show/resource/Resource.definition.js +15 -5
  78. package/lib/cli/show/resource/Resource.definition.js.map +1 -1
  79. package/lib/cli/show/resource/Resource.handler.js +2 -2
  80. package/lib/cli/show/resource/Resource.handler.js.map +1 -1
  81. package/lib/cli/show/rule/Rule.definition.js +12 -2
  82. package/lib/cli/show/rule/Rule.definition.js.map +1 -1
  83. package/lib/cli/show/rule/Rule.handler.js +11 -5
  84. package/lib/cli/show/rule/Rule.handler.js.map +1 -1
  85. package/lib/cli/show/ruleset/Ruleset.definition.d.ts +17 -0
  86. package/lib/cli/show/ruleset/Ruleset.definition.js +70 -0
  87. package/lib/cli/show/ruleset/Ruleset.definition.js.map +1 -0
  88. package/lib/cli/show/ruleset/Ruleset.handler.d.ts +5 -0
  89. package/lib/{api/methods/show/Show.js → cli/show/ruleset/Ruleset.handler.js} +17 -19
  90. package/lib/cli/show/ruleset/Ruleset.handler.js.map +1 -0
  91. package/lib/cli/start/Start.definition.js +5 -5
  92. package/lib/cli/start/Start.definition.js.map +1 -1
  93. package/lib/cli/start/resource/Resource.definition.js +9 -9
  94. package/lib/cli/start/resource/Resource.definition.js.map +1 -1
  95. package/lib/cli/start/resource/Resource.handler.js +5 -4
  96. package/lib/cli/start/resource/Resource.handler.js.map +1 -1
  97. package/lib/cli/stop/Stop.definition.js +5 -5
  98. package/lib/cli/stop/Stop.definition.js.map +1 -1
  99. package/lib/cli/stop/resource/Resource.definition.js +9 -9
  100. package/lib/cli/stop/resource/Resource.definition.js.map +1 -1
  101. package/lib/cli/stop/resource/Resource.handler.js +5 -4
  102. package/lib/cli/stop/resource/Resource.handler.js.map +1 -1
  103. package/lib/healthCheck.handler.js +1 -1
  104. package/lib/healthCheck.handler.js.map +1 -1
  105. package/lib/imperative.js +17 -10
  106. package/lib/imperative.js.map +1 -1
  107. package/lib/index.d.ts +6 -4
  108. package/lib/index.js +13 -7
  109. package/lib/index.js.map +1 -1
  110. package/package.json +30 -40
  111. package/lib/api/methods/index.d.ts +0 -2
  112. package/lib/api/methods/index.js.map +0 -1
  113. package/lib/api/methods/show/Show.d.ts +0 -5
  114. package/lib/api/methods/show/Show.js.map +0 -1
  115. package/lib/api/methods/show/index.d.ts +0 -1
  116. package/lib/api/methods/show/index.js.map +0 -1
  117. package/lib/api/methods/update/Update.js.map +0 -1
  118. package/lib/api/methods/update/index.d.ts +0 -1
  119. package/lib/api/methods/update/index.js.map +0 -1
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019 Broadcom. All Rights Reserved. The term
1
+ Copyright (c) 2024 Broadcom. All Rights Reserved. The term
2
2
  "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
3
3
 
4
4
  This software and all information contained therein is
package/README.md CHANGED
@@ -42,27 +42,23 @@ To install the OPS/MVS® plug-in to the Zowe CLI from source, issue the followin
42
42
  $ zowe plugins validate @broadcom/ops-for-zowe-cli
43
43
  ```
44
44
 
45
- **Note:** For more information about using the install command,
46
- see [Manage Plug-ins.](**REMOVED**)
47
-
48
45
  ## Uninstall the OPS/MVS® Plug-in From Zowe CLI
49
46
  To uninstall the plug-in from Zowe CLI, issue the following command:
50
47
  ```sh
51
48
  $ zowe plugins uninstall @broadcom/ops-for-zowe-cli
52
49
  ```
53
50
 
54
- **Note:** For more information about using the uninstall command,
55
- see [Manage Plug-ins.](**REMOVED**)
56
-
57
51
  ### Create an OPS/MVS® Profile
58
52
 
59
53
  To create an OPS/MVS® plug-in profile gather the following data:
60
- - The host name of the LPAR on which OPS/MVS® Web Services is running
61
- - The OPS/MVS® Web Services port number
62
- - A user name that has authority to access OPS/MVS® Web Services
63
- - The password to the account tied to the user name
54
+ - The host name of the LPAR on which OPS/MVS® Web Services or OPS/MVS® REST API server is running
55
+ - The OPS/MVS® Web Services or OPS/MVS® REST API server port number
56
+ - A user name that has authority to access OPS/MVS® Web Services or OPS/MVS® REST API server
57
+ - The password to the account assigned to the user name
64
58
 
65
- To create an OPS/MVS® profile, issue the following command:
59
+ To create an OPS/MVS® profile, edit the "global config" located at ~/'.zowe/zowe.config.json' file:
66
60
  ```sh
67
- $ zowe profiles create ops myLPAR --hostname mylpar.example.com --port 1234 --username myself --password fakepassword
61
+ $ zowe config edit --gc
68
62
  ```
63
+ NOTE: See the 'zowe.config.example.json' file in this project for examples of
64
+ profiles for both OPS/MVS® Web Services or OPS/MVS® REST API server.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -23,59 +23,63 @@
23
23
  */
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.OpsProfilesConfig = void 0;
26
- const utils_1 = require("./utils");
26
+ const OpsRestUtils_1 = require("./utils/OpsRestUtils");
27
27
  exports.OpsProfilesConfig = [
28
28
  {
29
29
  type: "ops",
30
30
  schema: {
31
31
  type: "object",
32
- title: "OPS Web Services session profile",
33
- description: "The OPS Web Services session profile schema, where you specify your session information and credentials",
32
+ title: "OPS/MVS Web Services / REST API session profile",
33
+ description: "The OPS/MVS Web Services / REST API session profile schema, where you specify your session information and credentials",
34
34
  properties: {
35
35
  host: {
36
- optionDefinition: utils_1.OpsRestUtils.HOST_OPTION,
36
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.HOST_OPTION,
37
37
  type: "string",
38
38
  },
39
39
  port: {
40
- optionDefinition: utils_1.OpsRestUtils.PORT_OPTION,
40
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.PORT_OPTION,
41
41
  type: "number",
42
42
  },
43
43
  user: {
44
- optionDefinition: utils_1.OpsRestUtils.USER_OPTION,
44
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.USER_OPTION,
45
45
  secure: true,
46
46
  type: "string",
47
47
  },
48
48
  password: {
49
- optionDefinition: utils_1.OpsRestUtils.PASSWORD_OPTION,
49
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.PASSWORD_OPTION,
50
50
  secure: true,
51
51
  type: "string",
52
52
  },
53
53
  protocol: {
54
- optionDefinition: utils_1.OpsRestUtils.PROTOCOL_OPTION,
54
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.PROTOCOL_OPTION,
55
55
  type: "string"
56
56
  },
57
57
  rejectUnauthorized: {
58
- optionDefinition: utils_1.OpsRestUtils.REJECT_UNAUTHORIZED_OPTION,
58
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.REJECT_UNAUTHORIZED_OPTION,
59
59
  type: "boolean"
60
60
  },
61
61
  subsystem: {
62
- optionDefinition: utils_1.OpsRestUtils.SUBSYSTEM_OPTION,
62
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.SUBSYSTEM_OPTION,
63
63
  type: "string"
64
+ },
65
+ restApi: {
66
+ optionDefinition: OpsRestUtils_1.OpsRestUtils.RESTAPI_OPTION,
67
+ type: "boolean"
64
68
  }
65
69
  },
70
+ // required: ["host", "port"],
66
71
  },
67
- // validationPlanModule: __dirname + "/OpsProfileValidationPlan",
68
72
  createProfileExamples: [
69
73
  {
70
74
  options: "myLPAR --host lpar123 --port 8080 --user ibmuser --password !@#$^ --prot http --reject-unauthorized false",
71
- description: "Create an OPS profile called 'myLPAR' to connect to OPS Web Services at host lpar123 and port 8080, " +
75
+ description: "Create an OPS profile called 'myLPAR' to connect to OPS/MVS REST API at host lpar123 and port 8080, " +
72
76
  "using http protocol, allowing self-signed certificates"
73
77
  }
74
78
  ],
75
79
  updateProfileExamples: [
76
80
  {
77
81
  options: "myLPAR --host lpar456",
78
- description: "Update an OPS profile called 'myLPAR' to connect to OPS Web Services at host lpar456"
82
+ description: "Update an OPS profile called 'myLPAR' to connect to OPS/MVS Web Services at host lpar456"
79
83
  },
80
84
  {
81
85
  options: "myLPAR --user user101 --password Km5sv78",
@@ -1 +1 @@
1
- {"version":3,"file":"OpsProfilesConfig.js","sourceRoot":"","sources":["../../src/api/OpsProfilesConfig.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAGH,mCAAqC;AAExB,QAAA,iBAAiB,GAAwC;IAClE;QACI,IAAI,EAAE,KAAK;QACX,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,kCAAkC;YACzC,WAAW,EAAE,yGAAyG;YACtH,UAAU,EAAE;gBACR,IAAI,EAAE;oBACF,gBAAgB,EAAE,oBAAY,CAAC,WAAW;oBAC1C,IAAI,EAAE,QAAQ;iBACjB;gBACD,IAAI,EAAE;oBACF,gBAAgB,EAAE,oBAAY,CAAC,WAAW;oBAC1C,IAAI,EAAE,QAAQ;iBACjB;gBACD,IAAI,EAAE;oBACF,gBAAgB,EAAE,oBAAY,CAAC,WAAW;oBAC1C,MAAM,EAAE,IAAI;oBACZ,IAAI,EAAE,QAAQ;iBACjB;gBACD,QAAQ,EAAE;oBACN,gBAAgB,EAAE,oBAAY,CAAC,eAAe;oBAC9C,MAAM,EAAE,IAAI;oBACZ,IAAI,EAAE,QAAQ;iBACjB;gBACD,QAAQ,EAAE;oBACN,gBAAgB,EAAE,oBAAY,CAAC,eAAe;oBAC9C,IAAI,EAAE,QAAQ;iBACjB;gBACD,kBAAkB,EAAE;oBAChB,gBAAgB,EAAE,oBAAY,CAAC,0BAA0B;oBACzD,IAAI,EAAE,SAAS;iBAClB;gBACD,SAAS,EAA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B,EAAE;oBAChB,gBAAgB,EAAE,2BAAY,CAAC,0BAA0B;oBACzD,IAAI,EAAE,SAAS;iBAClB;gBACD,SAAS,EAAE;oBACP,gBAAgB,EAAE,2BAAY,CAAC,gBAAgB;oBAC/C,IAAI,EAAE,QAAQ;iBACjB;gBACD,OAAO,EAAE;oBACL,gBAAgB,EAAE,2BAAY,CAAC,cAAc;oBAC7C,IAAI,EAAE,SAAS;iBAClB;aACJ;YACD,8BAA8B;SACjC;QACD,qBAAqB,EAAE;YACnB;gBACI,OAAO,EAAE,2GAA2G;gBACpH,WAAW,EAAE,sGAAsG;oBAC/G,wDAAwD;aAC/D;SACJ;QACD,qBAAqB,EAAE;YACnB;gBACI,OAAO,EAAE,uBAAuB;gBAChC,WAAW,EAAE,0FAA0F;aAC1G;YACD;gBACI,OAAO,EAAE,0CAA0C;gBACnD,WAAW,EAAE,sFAAsF;aACtG;SACJ;KACJ;CACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { IHandlerParameters, Session } from "@zowe/imperative";
2
+ import { IShowRuleResponse } from "./doc/IShowRuleResponse";
3
+ import { IShowResourceResponse } from "./doc/IShowResourceResponse";
4
+ export declare function showRule(session: Session, ruleSetName: string, ruleName: string, restApi: boolean, subSystem: string): Promise<IShowRuleResponse>;
5
+ export declare function showResource(session: Session, resourceName: string, restApi: boolean, table: string, subsystem: string): Promise<IShowResourceResponse>;
6
+ export declare function showRuleset(session: Session, ruleSetName: string, restApi: boolean, subSystem: string, params: IHandlerParameters): Promise<IShowRuleResponse>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
+ * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
+ *
6
+ * This software and all information contained therein is
7
+ * confidential and proprietary and shall not be duplicated,
8
+ * used, disclosed, or disseminated in any way except as
9
+ * authorized by the applicable license agreement, without the
10
+ * express written permission of Broadcom. All authorized
11
+ * reproductions must be marked with this language.
12
+ *
13
+ * EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO
14
+ * THE EXTENT PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS
15
+ * SOFTWARE WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT
16
+ * LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
17
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL BROADCOM
18
+ * BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR
19
+ * DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE,
20
+ * INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS
21
+ * INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF BROADCOM IS
22
+ * EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
23
+ */
24
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
25
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26
+ return new (P || (P = Promise))(function (resolve, reject) {
27
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
28
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ Object.defineProperty(exports, "__esModule", { value: true });
34
+ exports.showRuleset = exports.showResource = exports.showRule = void 0;
35
+ const RuleUtils_1 = require("./utils/RuleUtils");
36
+ const RulesetUtils_1 = require("./utils/RulesetUtils");
37
+ const SSMUtils_1 = require("./utils/SSMUtils");
38
+ const constants_1 = require("./constants");
39
+ const OpsRestClient_1 = require("./utils/OpsRestClient");
40
+ function showRule(session, ruleSetName, ruleName, restApi, subSystem) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const ruleUrl = RuleUtils_1.RuleUtils.getRuleURL(session, ruleSetName, ruleName, restApi, subSystem);
43
+ return OpsRestClient_1.OpsRestClient.getExpectJSON(session, ruleUrl, constants_1.OpsConstants.headers);
44
+ });
45
+ }
46
+ exports.showRule = showRule;
47
+ function showResource(session, resourceName, restApi, table, subsystem) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ const resourceUrl = SSMUtils_1.SSMUtils.getResourceURL(session, resourceName, restApi, table, subsystem);
50
+ return OpsRestClient_1.OpsRestClient.getExpectJSON(session, resourceUrl, constants_1.OpsConstants.headers);
51
+ });
52
+ }
53
+ exports.showResource = showResource;
54
+ function showRuleset(session, ruleSetName, restApi, subSystem, params) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ if (restApi) {
57
+ const rulesetUrl = RulesetUtils_1.RulesetUtils.getRulesetURL(session, ruleSetName, restApi, subSystem);
58
+ return OpsRestClient_1.OpsRestClient.getExpectJSON(session, rulesetUrl, constants_1.OpsConstants.headers);
59
+ }
60
+ else {
61
+ // Display message indicating 'show ruleset' not supported with web services
62
+ params.response.console.log("Command 'show ruleset' is only supported with the OPS/MVS REST API server");
63
+ }
64
+ });
65
+ }
66
+ exports.showRuleset = showRuleset;
67
+ //# sourceMappingURL=Show.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Show.js","sourceRoot":"","sources":["../../src/api/Show.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAGH,iDAA8C;AAC9C,uDAAoD;AACpD,+CAA4C;AAC5C,2CAA2C;AAG3C,yDAAsD;AAEtD,SAAsB,QAAQ,CAAC,OAAgB,EAAE,WAAmB,EAAE,QAAgB,EAAE,OAAgB,EACzE,SAAiB;;QAC5C,MAAM,OAAO,GAAG,qBAAS,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QACzF,OAAO,6BAAa,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,wBAAY,CAAC,OAAO,CAAC,CAAC;IAC/E,CAAC;CAAA;AAJD,4BAIC;AAED,SAAsB,YAAY,CAAC,OAAgB,EAAE,YAAoB,EAAE,OAAgB,EAAE,KAAa,EACvE,SAAiB;;QAChD,MAAM,WAAW,GAAG,mBAAQ,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC9F,OAAO,6BAAa,CAAC,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,wBAAY,CAAC,OAAO,CAAC,CAAC;IACnF,CAAC;CAAA;AAJD,oCAIC;AAED,SAAsB,WAAW,CAAC,OAAgB,EAAE,WAAmB,EAAE,OAAgB,EACvD,SAAiB,EAAE,MAA0B;;QAE3E,IAAI,OAAO,EAAE;YACT,MAAM,UAAU,GAAG,2BAAY,CAAC,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;YACxF,OAAO,6BAAa,CAAC,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,wBAAY,CAAC,OAAO,CAAC,CAAC;SACjF;aAAM;YACH,4EAA4E;YAC5E,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;SAC5G;IACL,CAAC;CAAA;AAVD,kCAUC"}
@@ -1,8 +1,8 @@
1
1
  import { Session } from "@zowe/imperative";
2
2
  export declare function updateRule(session: Session, ruleSetName: string, ruleName: string, newStatus: string, // eslint-disable-line
3
- subSystem?: string): Promise<{}>;
3
+ restApi: boolean, subSystem?: string): Promise<{}>;
4
4
  /**
5
5
  * updateResource
6
6
  */
7
- export declare function updateResource(session: Session, resource: string, desiredState: string, subsystem?: string, // eslint-disable-line
7
+ export declare function updateResource(session: Session, resource: string, restApi: boolean, desiredState: string, subsystem?: string, // eslint-disable-line
8
8
  table?: string, wait?: number): Promise<{}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -33,36 +33,52 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
34
  exports.updateResource = exports.updateRule = void 0;
35
35
  const imperative_1 = require("@zowe/imperative");
36
- const constants_1 = require("../../constants");
37
- const utils_1 = require("../../utils");
38
- const ResourceParameterDefinitions_1 = require("../../../cli/ResourceParameterDefinitions");
39
- const show_1 = require("../show");
36
+ const constants_1 = require("./constants");
37
+ const RuleUtils_1 = require("./utils/RuleUtils");
38
+ const SSMUtils_1 = require("./utils/SSMUtils");
39
+ const ResourceParameterDefinitions_1 = require("../cli/ResourceParameterDefinitions");
40
+ const Show_1 = require("./Show");
41
+ const OpsRestClient_1 = require("./utils/OpsRestClient");
40
42
  function updateRule(session, ruleSetName, ruleName, newStatus, // eslint-disable-line
41
- subSystem) {
43
+ restApi, subSystem) {
42
44
  return __awaiter(this, void 0, void 0, function* () {
43
- const ruleUrl = utils_1.RuleUtils.getRuleURL(session, ruleSetName, ruleName, subSystem);
44
- const postBody = {
45
+ const ruleUrl = RuleUtils_1.RuleUtils.getRuleURL(session, ruleSetName, ruleName, restApi, subSystem);
46
+ const body = {
45
47
  status: newStatus
46
48
  };
47
- return imperative_1.RestClient.postExpectJSON(session, ruleUrl, constants_1.OpsConstants.headers, postBody);
49
+ if (restApi === false) {
50
+ return OpsRestClient_1.OpsRestClient.postExpectJSON(session, ruleUrl, constants_1.OpsConstants.headers, body);
51
+ }
52
+ else {
53
+ return OpsRestClient_1.OpsRestClient.putExpectJSON(session, ruleUrl, constants_1.OpsConstants.headers, body);
54
+ }
48
55
  });
49
56
  }
50
57
  exports.updateRule = updateRule;
51
58
  /**
52
59
  * updateResource
53
60
  */
54
- function updateResource(session, resource, desiredState, subsystem, // eslint-disable-line
61
+ function updateResource(session, resource, restApi, desiredState, subsystem, // eslint-disable-line
55
62
  table, wait) {
56
63
  return __awaiter(this, void 0, void 0, function* () {
57
64
  if (wait != null) {
58
- imperative_1.ImperativeExpect.toBeEqual(wait > 0 && wait <= ResourceParameterDefinitions_1.ResourceParameterDefinitions.ONE_DAY, true, "Wait value must be between 0 and " + ResourceParameterDefinitions_1.ResourceParameterDefinitions.ONE_DAY + "(inclusive) if specified. " +
65
+ imperative_1.ImperativeExpect.toBeEqual(wait > 0 && wait <= ResourceParameterDefinitions_1.ResourceParameterDefinitions.ONE_DAY, true, "Wait value must be between 0 and " + ResourceParameterDefinitions_1.ResourceParameterDefinitions.ONE_DAY + " (inclusive), if specified. " +
59
66
  "You specified: " + wait);
60
67
  }
61
- const resourceUrl = utils_1.SSMUtils.getResourceURL(session, resource, table, subsystem);
68
+ const resourceUrl = SSMUtils_1.SSMUtils.getResourceURLWithQueryParms(session, resource, restApi, table, subsystem);
62
69
  const postBody = {
63
70
  desired: desiredState
64
71
  };
65
- const response = yield imperative_1.RestClient.postExpectJSON(session, resourceUrl, constants_1.OpsConstants.headers, postBody);
72
+ const postBodyRestApi = {
73
+ desiredState: desiredState
74
+ };
75
+ let response;
76
+ if (restApi) {
77
+ response = yield OpsRestClient_1.OpsRestClient.putExpectJSON(session, resourceUrl, constants_1.OpsConstants.headers, postBodyRestApi);
78
+ }
79
+ else {
80
+ response = yield OpsRestClient_1.OpsRestClient.postExpectJSON(session, resourceUrl, constants_1.OpsConstants.headers, postBody);
81
+ }
66
82
  if (wait == null) {
67
83
  // if we're not waiting, just return immediately
68
84
  return response;
@@ -70,19 +86,31 @@ table, wait) {
70
86
  else {
71
87
  // we are waiting, so set up the polling to determine if current = desired state
72
88
  // did we happen to instantly start/ stop the resource the first time? check
73
- if (response.ssmresource[0].current.toUpperCase() === desiredState.toUpperCase()) {
74
- return response;
89
+ let currentState = "";
90
+ if (restApi) {
91
+ if (response.currentState.toUpperCase() === desiredState.toUpperCase())
92
+ return response;
93
+ currentState = response.currentState;
94
+ }
95
+ else {
96
+ if (response.ssmresource[0].current.toUpperCase() === desiredState.toUpperCase())
97
+ return response;
98
+ currentState = response.ssmresource[0].current;
75
99
  }
76
100
  // otherwise we have to poll
77
101
  let pollResponse;
78
- let currentState = response.ssmresource[0].current;
79
102
  const ONE_SECOND = 1000;
80
103
  const start = new Date().getTime();
81
104
  // looping with 'wait' value as max was taking approximately twice the requested time
82
105
  // so use the actual time to calculate when the 'wait' time is exceeded
83
106
  while (((new Date().getTime() - start) / ONE_SECOND) < wait) {
84
- pollResponse = yield show_1.showResource(session, resource, table, subsystem);
85
- currentState = pollResponse.ssmresource[0].current;
107
+ pollResponse = yield (0, Show_1.showResource)(session, resource, restApi, table, subsystem);
108
+ if (restApi) {
109
+ currentState = pollResponse[0].currentState;
110
+ }
111
+ else {
112
+ currentState = pollResponse.ssmresource[0].current;
113
+ }
86
114
  if (currentState.toUpperCase() === desiredState.toUpperCase()) {
87
115
  // successfully waited until the desired state equaled the current state
88
116
  return pollResponse;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Update.js","sourceRoot":"","sources":["../../src/api/Update.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAEH,iDAA8E;AAC9E,2CAA2C;AAC3C,iDAA8C;AAC9C,+CAA4C;AAC5C,sFAAmF;AACnF,iCAAsC;AACtC,yDAAsD;AAEtD,SAAsB,UAAU,CAAC,OAAgB,EAAE,WAAmB,EACrC,QAAgB,EAAE,SAAiB,EAAG,sBAAsB;AAC5D,OAAgB,EAAE,SAAkB;;QAEjE,MAAM,OAAO,GAAG,qBAAS,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QACzF,MAAM,IAAI,GAAG;YACT,MAAM,EAAE,SAAS;SACpB,CAAC;QAEF,IAAI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H,mDAAmD;oBACnD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;wBAC1B,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;oBACpC,CAAC,CAAC,CAAC;iBACN;aACJ;YAED,4CAA4C;YAC5C,MAAM,IAAI,4BAAe,CAAC;gBACtB,GAAG,EAAE,8BAA8B,IAAI,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,qCAAqC;oBACrG,iBAAiB,QAAQ,cAAc,YAAY,GAAG;aAC7D,CAAC,CAAC;SACN;IACL,CAAC;CAAA;AAzED,wCAyEC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -30,12 +30,14 @@ exports.OpsConstants = {
30
30
  APP_URL: "/opsmvs/api",
31
31
  VERSION: "v1",
32
32
  BASE_URL: "/opsmvs/api/v1",
33
- AOF_URL: "/opsmvs/api/v1/aof",
34
- RULESET_URL: "/opsmvs/api/v1/aof/rulesets",
33
+ AOF_URL: "/api/v1/aof",
34
+ OPSMVS_URL: "/opsmvs",
35
+ RULES_URL: "/api/v1/aof/rules",
36
+ RULESET_URL: "/api/v1/aof/rulesets",
35
37
  RULE_URL: "/rules",
36
38
  STATUS_URL: "/status",
37
- SSM_URL: "/opsmvs/api/v1/ssm",
38
- RESOURCES_URL: "/opsmvs/api/v1/ssm/resources",
39
+ SSM_URL: "/api/v1/ssm",
40
+ RESOURCES_URL: "/api/v1/ssm/resources",
39
41
  STATE_URL: "/state",
40
42
  headers: [{ "Content-Type": "application/json" }, { Accept: "application/json" }]
41
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Ops.constants.js","sourceRoot":"","sources":["../../../src/api/constants/Ops.constants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH;;GAEG;AACU,QAAA,YAAY,GAA2B;IAChD,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,gBAAgB;IAC1B,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,oBAAoB;IAC7B,aAAa,EAAE,8BAA8B;IAC7C,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,CAAC,EAAC,cAAc,EAAE,kBAAkB,EAAC,EAAE,EAAC,MAAM,EAAG,kBAAkB,EAAC,CAAC;CACjF,CAAC"}
1
+ {"version":3,"file":"Ops.constants.js","sourceRoot":"","sources":["../../../src/api/constants/Ops.constants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH;;GAEG;AACU,QAAA,YAAY,GAA2B;IAChD,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,gBAAgB;IAC1B,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,mBAAmB;IAC9B,WAAW,EAAE,sBAAsB;IACnC,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,aAAa;IACtB,aAAa,EAAE,uBAAuB;IACtC,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,CAAC,EAAC,cAAc,EAAE,kBAAkB,EAAC,EAAE,EAAC,MAAM,EAAG,kBAAkB,EAAC,CAAC;CACjF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -23,13 +23,17 @@
23
23
  */
24
24
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25
25
  if (k2 === undefined) k2 = k;
26
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
26
+ var desc = Object.getOwnPropertyDescriptor(m, k);
27
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28
+ desc = { enumerable: true, get: function() { return m[k]; } };
29
+ }
30
+ Object.defineProperty(o, k2, desc);
27
31
  }) : (function(o, m, k, k2) {
28
32
  if (k2 === undefined) k2 = k;
29
33
  o[k2] = m[k];
30
34
  }));
31
35
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
37
  };
34
38
  Object.defineProperty(exports, "__esModule", { value: true });
35
39
  __exportStar(require("./Ops.constants"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/constants/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAEH,kDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/constants/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAEH,kDAAgC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -0,0 +1,12 @@
1
+ export interface IShowRulesetResponse {
2
+ count: number;
3
+ schemaVersion: string;
4
+ aofruleset: Array<{
5
+ sysplex: string;
6
+ system: string;
7
+ subsystem: string;
8
+ ruleset: string;
9
+ status: string;
10
+ autoEnabled: string;
11
+ }>;
12
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -21,16 +21,5 @@
21
21
  * INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF BROADCOM IS
22
22
  * EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
23
23
  */
24
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
27
- }) : (function(o, m, k, k2) {
28
- if (k2 === undefined) k2 = k;
29
- o[k2] = m[k];
30
- }));
31
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
33
- };
34
24
  Object.defineProperty(exports, "__esModule", { value: true });
35
- __exportStar(require("./Update"), exports);
36
- //# sourceMappingURL=index.js.map
25
+ //# sourceMappingURL=IShowRulesetResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IShowRulesetResponse.js","sourceRoot":"","sources":["../../../src/api/doc/IShowRulesetResponse.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
@@ -1,3 +1,6 @@
1
- export * from "./methods";
1
+ export * from "./Show";
2
+ export * from "./Update";
2
3
  export * from "./constants";
3
4
  export * from "./utils";
5
+ export * from "./doc/IShowResourceResponse";
6
+ export * from "./doc/IShowRuleResponse";
package/lib/api/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -23,16 +23,23 @@
23
23
  */
24
24
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25
25
  if (k2 === undefined) k2 = k;
26
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
26
+ var desc = Object.getOwnPropertyDescriptor(m, k);
27
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28
+ desc = { enumerable: true, get: function() { return m[k]; } };
29
+ }
30
+ Object.defineProperty(o, k2, desc);
27
31
  }) : (function(o, m, k, k2) {
28
32
  if (k2 === undefined) k2 = k;
29
33
  o[k2] = m[k];
30
34
  }));
31
35
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
37
  };
34
38
  Object.defineProperty(exports, "__esModule", { value: true });
35
- __exportStar(require("./methods"), exports);
39
+ __exportStar(require("./Show"), exports);
40
+ __exportStar(require("./Update"), exports);
36
41
  __exportStar(require("./constants"), exports);
37
42
  __exportStar(require("./utils"), exports);
43
+ __exportStar(require("./doc/IShowResourceResponse"), exports);
44
+ __exportStar(require("./doc/IShowRuleResponse"), exports);
38
45
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;AAEH,4CAA0B;AAC1B,8CAA4B;AAC5B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;AAEH,yCAAuB;AACvB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,8DAA4C;AAC5C,0DAAwC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Copyright (c) 2019 Broadcom. All Rights Reserved. The term
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
4
  * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
5
  *
6
6
  * This software and all information contained therein is
@@ -0,0 +1,15 @@
1
+ import { IImperativeError, Logger, RestClient } from "@zowe/imperative";
2
+ export declare class OpsRestClient extends RestClient {
3
+ /**
4
+ * Use the Zowe logger instead of the imperative logger
5
+ * @type {Logger}
6
+ */
7
+ get log(): Logger;
8
+ /**
9
+ * Process an error encountered in the rest client
10
+ * @param {IImperativeError} original - the original error automatically built by the abstract rest client
11
+ * @returns {IImperativeError} - the processed error with details added
12
+ * @memberof ZosmfRestClient
13
+ */
14
+ protected processError(original: IImperativeError): IImperativeError;
15
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2024 Broadcom. All Rights Reserved. The term
4
+ * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
5
+ *
6
+ * This software and all information contained therein is
7
+ * confidential and proprietary and shall not be duplicated,
8
+ * used, disclosed, or disseminated in any way except as
9
+ * authorized by the applicable license agreement, without the
10
+ * express written permission of Broadcom. All authorized
11
+ * reproductions must be marked with this language.
12
+ *
13
+ * EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO
14
+ * THE EXTENT PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS
15
+ * SOFTWARE WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT
16
+ * LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR
17
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL BROADCOM
18
+ * BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR
19
+ * DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE,
20
+ * INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS
21
+ * INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF BROADCOM IS
22
+ * EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE.
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.OpsRestClient = void 0;
26
+ const imperative_1 = require("@zowe/imperative");
27
+ class OpsRestClient extends imperative_1.RestClient {
28
+ /**
29
+ * Use the Zowe logger instead of the imperative logger
30
+ * @type {Logger}
31
+ */
32
+ get log() {
33
+ return imperative_1.Logger.getAppLogger();
34
+ }
35
+ /**
36
+ * Process an error encountered in the rest client
37
+ * @param {IImperativeError} original - the original error automatically built by the abstract rest client
38
+ * @returns {IImperativeError} - the processed error with details added
39
+ * @memberof ZosmfRestClient
40
+ */
41
+ processError(original) {
42
+ original.msg = "OPS REST API Error:\n" + original.msg;
43
+ let details = original.causeErrors;
44
+ try {
45
+ const json = JSON.parse(details);
46
+ // if we didn't get an error trying to parse json, check if there is a stack
47
+ // on the JSON error and delete it
48
+ if (json.stack != null) {
49
+ this.log.error("An error was encountered in OPS with a stack." +
50
+ " Here is the full error before deleting the stack:\n%s", JSON.stringify(json));
51
+ this.log.error("The stack has been deleted from the error before displaying the error to the user");
52
+ delete json.stack; // remove the stack field
53
+ }
54
+ // if we didn't get an error, make the parsed details part of the error
55
+ details = imperative_1.TextUtils.prettyJson(json, undefined, false);
56
+ }
57
+ catch (e) {
58
+ // if there's an error, the causeErrors text is not json
59
+ this.log.debug("Encountered an error trying to parse causeErrors as JSON - causeErrors is likely not JSON format");
60
+ }
61
+ original.msg += "\n" + details; // add the data string which is the original error
62
+ return original;
63
+ }
64
+ }
65
+ exports.OpsRestClient = OpsRestClient;
66
+ //# sourceMappingURL=OpsRestClient.js.map