@opscompass/opscompass-cli 1.0.8 → 1.0.9

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.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Users need to be able to enter array data into the CLI. They do this by submitting identical argument names with each element value.
3
+ * This method consolidates all data associated with the specified argument names, and creates an array object.
4
+ * @param {string[]} argumentNames an array of the argument names to consolidate on
5
+ * @param {string[]} args the raw arguments to use when consolidating the arrays
6
+ * @returns the arguments with the array arguments consolidated into arrays.
7
+ */
8
+ function setArgumentArrays(argumentNames, args) {
9
+ const indexesToRemove = [];
10
+
11
+ // iterate over each expected array argument name
12
+ argumentNames.forEach((argumentName) => {
13
+ let capturingArgument = false;
14
+
15
+ // Filter args down to array of values that match the current argument name
16
+ const argumentArray = args.filter(function(value, index) {
17
+ // The args array elements first have the argument name, and the element following is the value.
18
+ if (value === argumentName) {
19
+ // we want to mark this element for future deletion because it is a matching argument name,
20
+ // and set capturingArgument to true so it captures the next element in the array
21
+ indexesToRemove.push(index);
22
+ capturingArgument = true;
23
+ } else if (capturingArgument) {
24
+ // we want to mark this value for future deletion, set capturingArgument to false (since we just want to capture one array element),
25
+ // and then return true to return the argument value in the end array.
26
+ indexesToRemove.push(index);
27
+ capturingArgument = false;
28
+ return true;
29
+ }
30
+ });
31
+
32
+ // Appending the original argument name and the finalized argument array
33
+ // to the end of the args array will prevent it from being deleted.
34
+ if (argumentArray.length) {
35
+ args.push(argumentName);
36
+ args.push(argumentArray);
37
+ }
38
+ });
39
+
40
+ // Now that we are done, we want to delete all elements that match the CLI array argument structure
41
+ args = args.filter(function(value, index) {
42
+ return indexesToRemove.indexOf(index) == -1;
43
+ });
44
+
45
+ return args;
46
+ }
47
+
48
+ module.exports = {
49
+ setArgumentArrays
50
+ };
package/license.txt ADDED
@@ -0,0 +1,33 @@
1
+ OPCOMPASS™ COMMAND LINE INTERFACE
2
+ LICENSE AGREEMENT
3
+
4
+ IMPORTANT! READ CAREFULLY: THIS IS A LEGAL AGREEMENT. BY DOWNLOADING, INSTALLING, COPYING, SAVING ON YOUR COMPUTER, OR OTHERWISE USING THIS TOOL, YOU (LICENSEE, AS DEFINED BELOW) ARE BECOMING A PARTY TO THIS AGREEMENT AND YOU ARE CONSENTING TO BE BOUND BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
5
+ IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, YOU SHOULD NOT DOWNLOAD, INSTALL, OR USE THE TOOL.
6
+
7
+ 1. PARTIES
8
+ (a) "Licensor" means OpsCompass, Inc., having its principal place of business at 11422 Miracle Hills Dr #300, Omaha, NE 68154.
9
+ (b) "Licensee" means an individual or a legal entity entering into and exercising rights under this Agreement or future versions thereof. Licensee is also referred to herein as "You".
10
+
11
+ 2. DEFINITIONS
12
+ "Tool" means the software program known as the OpsCompass™ Command Line Interface in its delivered form, including its source code and documentation (if any).
13
+
14
+ 3. OWNERSHIP
15
+ The Tool is the property of Licensor. The Tool is licensed, not sold. Title and copyrights to the Tool, in whole and in part and all copies thereof, and all modifications, enhancements, derivatives and other alterations of the Tool regardless of who made any modifications, if any, are, and will remain, the sole and exclusive property of Licensor.
16
+
17
+ 4. GRANT OF LICENSE
18
+ Subject to the terms, conditions, and limitations set forth in this Agreement, including any amendments thereto, Licensor hereby grants to Licensee a limited, non-exclusive, perpetual license to install and use the Tool in accordance with the Tool documentation and pursuant to the terms and conditions of this Agreement.
19
+
20
+ 5. FEEDBACK
21
+ Licensee may, but is not obligated to, provide to Licensor or its subsidiaries suggestions, comments and feedback regarding the Tool, including but not limited to usability, bug reports and test results (collectively, "Feedback"). All right, title, and interest in the Feedback shall belong to Licensor for its unlimited use and Licensee agrees to perform any reasonable tasks necessary to document Licensor’s ownership in the same.
22
+
23
+ 6. NO WARRANTY
24
+ THE TOOL IS PROVIDED TO LICENSEE "AS IS" AND WITHOUT WARRANTIES. LICENSOR MAKES NO WARRANTY AS TO ITS USE OR PERFORMANCE. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR AND ITS AFFILIATES, SUPPLIERS, AND RESELLERS, DISCLAIM ALL OTHER WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE TOOL, AND THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES.
25
+
26
+ 7. DISCLAIMER OF DAMAGES
27
+ (a) TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR OR ITS AFFILIATES, LICENSORS, SUPPLIERS OR RESELLERS BE LIABLE TO LICENSEE UNDER ANY THEORY FOR ANY DAMAGES SUFFERED BY LICENSEE OR ANY USER OF THE TOOL, OR FOR ANY SPECIAL, INCIDENTAL, INDIRECT, CONSEQUENTIAL, OR SIMILAR DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR BUSINESS INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO MEET ANY DUTY INCLUDING OF GOOD FAITH OR OF REASONABLE CARE, FOR NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF THE USE OR INABILITY TO USE THE TOOL, OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.
28
+ (b) IN ANY CASE, LICENSOR'S ENTIRE LIABILITY UNDER ANY PROVISION OF THIS AGREEMENT WILL BE LIMITED TO THE AMOUNT ACTUALLY PAID BY LICENSEE FOR THE TOOL UNDER THIS AGREEMENT OR FIVE (5) USD, WHICHEVER IS GREATER.
29
+
30
+ 8. GENERAL
31
+ (a) Licensor reserves the right at any time to cease the support of the Tool and to alter features, specifications, capabilities, functions, licensing terms, release dates, general availability or other characteristics of the Tool.
32
+ (b) This Agreement constitutes the entire agreement between the parties concerning Licensee's use of the Tool, and supersedes any and all prior or contemporaneous oral or written representations, communications, or advertising with respect to the Tool.
33
+ (c) This Agreement will be governed by the laws of Nebraska, in the United States, without reference to conflict of laws principles. Licensee agrees that any litigation relating to this Agreement may only be brought in, and will be subject to the jurisdiction of, the state, local, and federal courts located in Douglas County, Nebraska.
@@ -0,0 +1,498 @@
1
+
2
+ const { setArgumentArrays } = require("../lib/cliHelpers.js");
3
+ const { getOpsCompassClient } = require("../opscompass.js");
4
+
5
+ async function listMonitoringConfigurations(args) {
6
+ let company = undefined;
7
+ for (let i = 0; i < args.length - 1; i++) {
8
+ switch (args[i].toLowerCase()) {
9
+ case "--company":
10
+ company = args[++i];
11
+ break;
12
+ }
13
+ }
14
+
15
+ const client = await getOpsCompassClient();
16
+ const monitoringConfigs = await client.licenseManager.listMonitoringConfigurations(company);
17
+
18
+ console.log(JSON.stringify(monitoringConfigs, null, 2));
19
+ }
20
+
21
+ async function deleteVCenterConfiguration(args){
22
+ let id = undefined;
23
+ for (let i = 0; i < args.length - 1; i++) {
24
+ switch (args[i].toLowerCase()) {
25
+ case "--id":
26
+ id = args[++i];
27
+ break;
28
+ }
29
+ }
30
+
31
+ const client = await getOpsCompassClient();
32
+ const response = await client.licenseManager.deleteVCenterConfiguration(id);
33
+
34
+ console.log(JSON.stringify(response, null, 2));
35
+ }
36
+
37
+ async function deleteMonitoringConfiguration(args){
38
+ let id = undefined;
39
+ for (let i = 0; i < args.length - 1; i++) {
40
+ switch (args[i].toLowerCase()) {
41
+ case "--id":
42
+ id = args[++i];
43
+ break;
44
+ }
45
+ }
46
+
47
+ const client = await getOpsCompassClient();
48
+ const response = await client.licenseManager.deleteMonitoringConfiguration(id);
49
+
50
+ console.log(JSON.stringify(response, null, 2));
51
+ }
52
+
53
+ async function deleteOracleDatabaseConfiguration(args){
54
+ let id = undefined;
55
+ for (let i = 0; i < args.length - 1; i++) {
56
+ switch (args[i].toLowerCase()) {
57
+ case "--id":
58
+ id = args[++i];
59
+ break;
60
+ }
61
+ }
62
+
63
+ const client = await getOpsCompassClient();
64
+ const response = await client.licenseManager.deleteOracleDatabaseConfiguration(id);
65
+
66
+ console.log(JSON.stringify(response, null, 2));
67
+ }
68
+
69
+ async function listOracleDatabaseConfigurations(args) {
70
+ let monitoringConfigurationId = undefined;
71
+ for (let i = 0; i < args.length - 1; i++) {
72
+ switch (args[i].toLowerCase()) {
73
+ case "--monitoringconfigurationid":
74
+ monitoringConfigurationId = args[++i];
75
+ break;
76
+ }
77
+ }
78
+
79
+ const client = await getOpsCompassClient();
80
+ const monitoringConfigs = await client.licenseManager.listOracleDatabaseConfigurations(monitoringConfigurationId);
81
+
82
+ console.log(JSON.stringify(monitoringConfigs, null, 2));
83
+ }
84
+
85
+ async function getOracleDatabaseConfiguration(args) {
86
+ let id = undefined;
87
+ for (let i = 0; i < args.length - 1; i++) {
88
+ switch (args[i].toLowerCase()) {
89
+ case "--id":
90
+ id = args[++i];
91
+ break;
92
+ }
93
+ }
94
+
95
+ const client = await getOpsCompassClient();
96
+ const monitoringConfigs = await client.licenseManager.getOracleDatabaseConfiguration(id);
97
+
98
+ console.log(JSON.stringify(monitoringConfigs, null, 2));
99
+ }
100
+
101
+ async function getSecretForConfiguration(args){
102
+ let id = undefined;
103
+ let recordType = undefined;
104
+ for (let i = 0; i < args.length - 1; i++) {
105
+ switch (args[i].toLowerCase()) {
106
+ case "--id":
107
+ id = args[++i];
108
+ break;
109
+ case "--recordtype":
110
+ recordType = args[++i];
111
+ break;
112
+ }
113
+ }
114
+
115
+ const client = await getOpsCompassClient();
116
+ const monitoringConfig = await client.licenseManager.getSecretForConfiguration(id, recordType);
117
+
118
+ console.log(JSON.stringify(monitoringConfig, null, 2));
119
+ }
120
+
121
+ async function getMonitoringConfiguration(args) {
122
+ let id = undefined;
123
+ let optionalParams = { asFile: undefined }
124
+ for (let i = 0; i < args.length - 1; i++) {
125
+ switch (args[i].toLowerCase()) {
126
+ case "--id":
127
+ id = args[++i];
128
+ break;
129
+ case "--asfile":
130
+ optionalParams.asFile = args[++i];
131
+ break;
132
+ }
133
+ }
134
+
135
+ const client = await getOpsCompassClient();
136
+ const monitoringConfig = await client.licenseManager.getMonitoringConfiguration(id, optionalParams);
137
+
138
+ console.log(JSON.stringify(monitoringConfig, null, 2));
139
+ }
140
+
141
+ async function createMonitoringConfiguration(args) {
142
+ let company = undefined;
143
+ let name = undefined;
144
+ for (let i = 0; i < args.length - 1; i++) {
145
+ switch (args[i].toLowerCase()) {
146
+ case "--company":
147
+ company = args[++i];
148
+ break;
149
+ case "--configurationname":
150
+ name = args[++i];
151
+ break;
152
+ }
153
+ }
154
+
155
+ const client = await getOpsCompassClient();
156
+ const monitoringConfig = await client.licenseManager.createMonitoringConfiguration(company, name);
157
+
158
+ console.log(JSON.stringify(monitoringConfig, null, 2));
159
+ }
160
+
161
+ async function listVCenterConfigurations(args) {
162
+ let id = undefined;
163
+ for (let i = 0; i < args.length - 1; i++) {
164
+ switch (args[i].toLowerCase()) {
165
+ case "--monitoringconfigurationid":
166
+ id = args[++i];
167
+ break;
168
+ }
169
+ }
170
+
171
+ const client = await getOpsCompassClient();
172
+ const listVCenterConfigs = await client.licenseManager.listVCenterConfigurations(id);
173
+
174
+ console.log(JSON.stringify(listVCenterConfigs, null, 2));
175
+ }
176
+
177
+ async function getVCenterConfiguration(args) {
178
+ let id = undefined;
179
+ for (let i = 0; i < args.length - 1; i++) {
180
+ switch (args[i].toLowerCase()) {
181
+ case "--id":
182
+ id = args[++i];
183
+ break;
184
+ }
185
+ }
186
+
187
+ const client = await getOpsCompassClient();
188
+ const getVCenterConfig = await client.licenseManager.getVCenterConfiguration(id);
189
+
190
+ console.log(JSON.stringify(getVCenterConfig, null, 2));
191
+ }
192
+
193
+ async function createVCenterConfiguration(args) {
194
+ let id = undefined;
195
+ let name = undefined;
196
+ let optionalParams = { action: undefined, connection: undefined, user: undefined, password: undefined };
197
+ for (let i = 0; i < args.length - 1; i++) {
198
+ switch (args[i].toLowerCase()) {
199
+ case "--monitoringconfigurationid":
200
+ id = args[++i];
201
+ break;
202
+ case "--name":
203
+ name = args[++i];
204
+ break;
205
+ case "--action":
206
+ optionalParams.action = args[++i];
207
+ break;
208
+ case "--connection":
209
+ optionalParams.connection = args[++i];;
210
+ break;
211
+ case "--user":
212
+ optionalParams.user = args[++i];
213
+ break;
214
+ case "--password":
215
+ optionalParams.password = args[++i];
216
+ break;
217
+ }
218
+ }
219
+
220
+ const client = await getOpsCompassClient();
221
+ const monitoringConfig = await client.licenseManager.createVCenterConfiguration(id, name, optionalParams);
222
+
223
+ console.log(JSON.stringify(monitoringConfig, null, 2));
224
+ }
225
+
226
+ async function createOracleDatabaseConfiguration(args) {
227
+ let id = undefined;
228
+ let name = undefined;
229
+ let optionalParams = { action: undefined, connection: undefined };
230
+ for (let i = 0; i < args.length - 1; i++) {
231
+ switch (args[i].toLowerCase()) {
232
+ case "--monitoringconfigurationid":
233
+ id = args[++i];
234
+ break;
235
+ case "--name":
236
+ name = args[++i];
237
+ break;
238
+ case "--action":
239
+ optionalParams.action = args[++i];
240
+ break;
241
+ case "--connectionstring":
242
+ optionalParams.connection = args[++i];
243
+ break;
244
+ }
245
+ }
246
+
247
+ const client = await getOpsCompassClient();
248
+ const monitoringConfig = await client.licenseManager.createOracleDatabaseConfiguration(id, name, optionalParams);
249
+
250
+ console.log(JSON.stringify(monitoringConfig, null, 2));
251
+ }
252
+
253
+ async function updateMonitoringConfiguration(args) {
254
+ // Prep any arguments that are arrays
255
+ args = setArgumentArrays(["--mailFrom", "--emailTo"], args);
256
+
257
+ const callParams = {};
258
+ for (let i = 0; i < args.length - 1; i++) {
259
+ switch (args[i].toLowerCase()) {
260
+ case "--id":
261
+ callParams.id = args[++i];
262
+ break;
263
+ case "--configurationname":
264
+ callParams.configurationName = args[++i];
265
+ break;
266
+ case "--datafileretaindays":
267
+ callParams.dataFileRetainDays = args[++i];
268
+ break;
269
+ case "--datafileretaintextdays":
270
+ callParams.dataFileRetainTextDays = args[++i];
271
+ break;
272
+ case "--forcefileencryption":
273
+ callParams.forceFileEncryption = args[++i];
274
+ break;
275
+ case "--datafiletag":
276
+ callParams.dataFileTag = args[++i];
277
+ break;
278
+ case "--mailfrom":
279
+ callParams.mailFrom = args[++i];
280
+ break;
281
+ case "--emailto":
282
+ callParams.emailTo = args[++i];
283
+ break;
284
+ case "--logfileretaindays":
285
+ callParams.logFileRetainDays = args[++i];
286
+ break;
287
+ case "--logfiletag":
288
+ callParams.logFileTag = args[++i];
289
+ break;
290
+ }
291
+ }
292
+
293
+ const client = await getOpsCompassClient();
294
+ const monitoringConfig = await client.licenseManager.updateMonitoringConfiguration(callParams.id, callParams);
295
+
296
+ console.log(JSON.stringify(monitoringConfig, null, 2));
297
+ }
298
+
299
+ async function updateOracleDatabaseConfiguration(args) {
300
+ const callParams = {};
301
+ for (let i = 0; i < args.length - 1; i++) {
302
+ switch (args[i].toLowerCase()) {
303
+ case "--id":
304
+ callParams.id = args[++i];
305
+ break;
306
+ case "--name":
307
+ callParams.name = args[++i];
308
+ break;
309
+ case "--action":
310
+ callParams.action = args[++i];
311
+ break;
312
+ case "--connectionstring":
313
+ callParams.connectionString = args[++i];
314
+ break;
315
+ }
316
+ }
317
+
318
+ const client = await getOpsCompassClient();
319
+ const oracleDatabaseConfiguration = await client.licenseManager.updateOracleDatabaseConfiguration(callParams.id, callParams);
320
+
321
+ console.log(JSON.stringify(oracleDatabaseConfiguration, null, 2));
322
+ }
323
+
324
+ async function updateVCenterConfiguration(args) {
325
+ const callParams = {};
326
+ for (let i = 0; i < args.length - 1; i++) {
327
+ switch (args[i].toLowerCase()) {
328
+ case "--id":
329
+ callParams.id = args[++i];
330
+ break;
331
+ case "--name":
332
+ callParams.name = args[++i];
333
+ break;
334
+ case "--action":
335
+ callParams.action = args[++i];
336
+ break;
337
+ case "--connection":
338
+ callParams.connection = args[++i];
339
+ break;
340
+ case "--user":
341
+ callParams.user = args[++i];
342
+ break;
343
+ case "--password":
344
+ callParams.password = args[++i];
345
+ break;
346
+ }
347
+ }
348
+
349
+ const client = await getOpsCompassClient();
350
+ const oracleDatabaseConfiguration = await client.licenseManager.updateVCenterConfiguration(callParams.id, callParams);
351
+
352
+ console.log(JSON.stringify(oracleDatabaseConfiguration, null, 2));
353
+ }
354
+
355
+ async function printHelp() {
356
+ console.log("Actions available for license-manager:");
357
+ console.log();
358
+ console.log("get-secret-for-configuration", "Gets a secret for a single configuration passed.");
359
+ console.log("Parameters:");
360
+ console.log("--id [vcenter_configuration_id | oracle_database_configuration_id]");
361
+ console.log("--recordType ['oracle_database_configuration' | 'vcenter_configuration'");
362
+ console.log();
363
+ console.log("list-monitoring-configurations", "Lists all of the monitoring configurations associated with the give company.");
364
+ console.log("Parameters:");
365
+ console.log("--company [company_slug]");
366
+ console.log();
367
+ console.log("get-monitoring-configuration", "Get a single monitoring configuration associated with the given company.");
368
+ console.log("Parameters:");
369
+ console.log("--id [monitoring_configuration_id]");
370
+ console.log("--asFile (optional) [true | false]");
371
+ console.log();
372
+ console.log("create-monitoring-configuration", "Create a single monitoring configuration associated with the given company.");
373
+ console.log("Parameters:");
374
+ console.log("--company [company_slug]");
375
+ console.log("--configurationName [configuration name]");
376
+ console.log();
377
+ console.log("list-oracle-database-configurations", "Lists all of the oracle database configurations associated with the given monitoring configuration");
378
+ console.log("Parameters:");
379
+ console.log("--monitoringConfigurationId [monitoring_configuration_id]");
380
+ console.log();
381
+ console.log("get-oracle-database-configuration", "Get a single oracle database configuration associated with the given monitoring configuration");
382
+ console.log("Parameters:");
383
+ console.log("--id [oracle_database_configuration_id]");
384
+ console.log();
385
+ console.log("list-vcenter-configurations", "Lists all of the vcenter configurations associated with the given monitoring configuration");
386
+ console.log("Parameters:");
387
+ console.log("--monitoringConfigurationId [monitoring_configuration_id]");
388
+ console.log();
389
+ console.log("get-vcenter-configuration", "Get a single vcenter configuration associated with the given monitoring configuration");
390
+ console.log("Parameters:");
391
+ console.log("--id [vcenter_configuration_id]");
392
+ console.log();
393
+ console.log("create-vcenter-configuration", "Create a single vcenter configuration associated with the given monitoring configuration.");
394
+ console.log("Parameters:");
395
+ console.log("--monitoringConfigurationId [monitoring_configuration_id]");
396
+ console.log("--name [unique name]");
397
+ console.log("--action (optional) [allowed actions: \"skip\"]");
398
+ console.log("--connection (optional) [the hostname or ip address]");
399
+ console.log("--user (optional) [connection username]");
400
+ console.log("--password (optional) [connection password]");
401
+ console.log();
402
+ console.log("create-oracle-database-configuration", "Create a single oracle database configuration associated with the given monitoring configuration.");
403
+ console.log("Parameters:");
404
+ console.log("--monitoringConfigurationId [monitoring_configuration_id]");
405
+ console.log("--name [unique name]");
406
+ console.log("--action (optional) [allowed actions: \"skip\"]");
407
+ console.log("--connectionString (optional) [the database connection string]");
408
+ console.log();
409
+ console.log("update-monitoring-configuration", "Update a single monitoring configuration.");
410
+ console.log("Parameters:");
411
+ console.log("--id [monitoring_configuration_id]");
412
+ console.log("--configurationName (optional) [unique name]");
413
+ console.log("--dataFileRetainDays (optional) [determines how many days to retain encrypted output files locally]");
414
+ console.log("--dataFileRetainTextDays (optional) [determines how many days to retain individual script output files locally]");
415
+ console.log("--forceFileEncryption (optional) [enforce encryption of datafiles before being sent]");
416
+ console.log("--dataFileTag (optional) [used to help filename generation to prevent duplicate file names]");
417
+ console.log("--mailFrom (optional) [Use parameter multiple times to send multiple email addresses. Identifies sender's email addresses when file delivery is done through email.]");
418
+ console.log("--emailTo (optional) [Use parameter multiple times to send multiple email addresses. Identifies the destination email addresses when file delivery is done through email.]");
419
+ console.log("--logFileRetainDays (optional) [determines how many days to retain log files locally]");
420
+ console.log("--logFileTag (optional) [used to help filename generation to prevent duplicate file names]");
421
+ console.log();
422
+ console.log("update-oracle-database-configuration", "Update a single oracle database configuration.");
423
+ console.log("Parameters:");
424
+ console.log("--id [monitoring_configuration_id]");
425
+ console.log("--name (optional) [unique name]");
426
+ console.log("--action (optional) [allowed actions: \"skip\"]");
427
+ console.log("--connectionString (optional) [the database connection string]");
428
+ console.log();
429
+ console.log("update-vcenter-configuration", "Update a single vcenter configuration.");
430
+ console.log("Parameters:");
431
+ console.log("--id [monitoring_configuration_id]");
432
+ console.log("--name (optional) [unique name]");
433
+ console.log("--action (optional) [allowed actions: \"skip\"]");
434
+ console.log("--connection (optional) [the hostname or ip address]");
435
+ console.log("--user (optional) [connection username]");
436
+ console.log("--password (optional) [connection password]");
437
+ console.log();
438
+ console.log("delete-monitoring-configuration", "Delete a monitoring configuration");
439
+ console.log("Parameters:");
440
+ console.log("--id [monitoring_configuration_id]");
441
+ console.log();
442
+ console.log("delete-oracle-database-configuration", "Delete a oracle database configuration");
443
+ console.log("Parameters:");
444
+ console.log("--id [oracle_database_configuration_id]");
445
+ console.log();
446
+ console.log("delete-vcenter-configuration", "Delete a vcenter configuration");
447
+ console.log("Parameters:");
448
+ console.log("--id [vcenter_configuration_id]");
449
+ console.log();
450
+ }
451
+
452
+ const licenseManagerModule = (action, ...args) => {
453
+ switch (action?.toLowerCase() ?? "") {
454
+ case "get-secret-for-configuration":
455
+ return getSecretForConfiguration(args);
456
+ case "list-monitoring-configurations":
457
+ return listMonitoringConfigurations(args);
458
+ case "get-monitoring-configuration":
459
+ return getMonitoringConfiguration(args);
460
+ case "create-monitoring-configuration":
461
+ return createMonitoringConfiguration(args);
462
+ case "list-vcenter-configurations":
463
+ return listVCenterConfigurations(args);
464
+ case "get-vcenter-configuration":
465
+ return getVCenterConfiguration(args);
466
+ case "create-vcenter-configuration":
467
+ return createVCenterConfiguration(args);
468
+ case "get-oracle-database-configuration":
469
+ return getOracleDatabaseConfiguration(args);
470
+ case "list-oracle-database-configurations":
471
+ return listOracleDatabaseConfigurations(args);
472
+ case "create-oracle-database-configuration":
473
+ return createOracleDatabaseConfiguration(args);
474
+ case "update-monitoring-configuration":
475
+ return updateMonitoringConfiguration(args);
476
+ case "update-oracle-database-configuration":
477
+ return updateOracleDatabaseConfiguration(args);
478
+ case "update-vcenter-configuration":
479
+ return updateVCenterConfiguration(args);
480
+ case "delete-monitoring-configuration":
481
+ return deleteMonitoringConfiguration(args);
482
+ case "delete-oracle-database-configuration":
483
+ return deleteOracleDatabaseConfiguration(args);
484
+ case "delete-vcenter-configuration":
485
+ return deleteVCenterConfiguration(args);
486
+ case "help":
487
+ case "":
488
+ return printHelp();
489
+ default:
490
+ console.log("Unknown command:", action);
491
+ return printHelp();
492
+ }
493
+ };
494
+
495
+ licenseManagerModule.requiresLogin = true;
496
+ licenseManagerModule.description = "Provides access to details about License Management in OpsCompass.";
497
+
498
+ module.exports = licenseManagerModule;
package/modules.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const resources = require("./modules/resources.js");
2
2
  const accounts = require("./modules/accounts.js");
3
+ const licenseManager = require("./modules/license-manager.js");
3
4
 
4
5
  /* login acts like a module, even though it's special */
5
6
  const login = require("./login.js");
@@ -8,4 +9,5 @@ module.exports = {
8
9
  login,
9
10
  resources,
10
11
  accounts,
12
+ "license-manager": licenseManager,
11
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opscompass/opscompass-cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Calls OpsCompass's APIs",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,9 +13,9 @@
13
13
  "opscompass"
14
14
  ],
15
15
  "author": "opscompass",
16
- "license": "UNLICENSED",
16
+ "license": "SEE LICENSE IN license.txt",
17
17
  "dependencies": {
18
- "@opscompass/opscompass-api": "^1.0.8",
18
+ "@opscompass/opscompass-api": "^1.0.9",
19
19
  "axios": "^0.21.1",
20
20
  "open": "^8.2.1"
21
21
  },