@opscompass/opscompass-cli 1.0.14 → 1.0.16
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.
- package/index.js +40 -5
- package/lib/homeInteraction.js +46 -25
- package/modules/accounts.js +1 -1
- package/modules/compliance.js +16 -3
- package/modules/data-gathering-scripts.js +160 -51
- package/modules/defaults.js +91 -0
- package/modules/license-manager.js +436 -124
- package/modules/resources.js +67 -2
- package/modules.js +3 -1
- package/package.json +2 -2
|
@@ -3,7 +3,6 @@ const { setArgumentArrays } = require("../lib/cliHelpers.js");
|
|
|
3
3
|
const { getOpsCompassClient } = require("../opscompass.js");
|
|
4
4
|
|
|
5
5
|
async function listMonitoringConfigurations(args) {
|
|
6
|
-
let company = undefined;
|
|
7
6
|
for (let i = 0; i < args.length - 1; i++) {
|
|
8
7
|
switch (args[i].toLowerCase()) {
|
|
9
8
|
case "--company":
|
|
@@ -82,11 +81,33 @@ async function deleteOracleDatabaseConfiguration(args){
|
|
|
82
81
|
console.log(JSON.stringify(response, null, 2));
|
|
83
82
|
}
|
|
84
83
|
|
|
84
|
+
async function deleteMssqlEntitlements(args){
|
|
85
|
+
args = setArgumentArrays(["--id"], args);
|
|
86
|
+
|
|
87
|
+
let recordIds = undefined;
|
|
88
|
+
let company = undefined;
|
|
89
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
90
|
+
switch (args[i].toLowerCase()) {
|
|
91
|
+
case "--company":
|
|
92
|
+
company = args[++i];
|
|
93
|
+
break;
|
|
94
|
+
case "--id":
|
|
95
|
+
recordIds = args[++i];
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const client = await getOpsCompassClient();
|
|
101
|
+
const response = await client.licenseManager.deleteMssqlEntitlements(company, recordIds);
|
|
102
|
+
|
|
103
|
+
console.log(JSON.stringify(response, null, 2));
|
|
104
|
+
}
|
|
105
|
+
|
|
85
106
|
async function listOracleDatabaseConfigurations(args) {
|
|
86
|
-
let monitoringConfigurationId = undefined;
|
|
87
107
|
for (let i = 0; i < args.length - 1; i++) {
|
|
88
108
|
switch (args[i].toLowerCase()) {
|
|
89
109
|
case "--monitoringconfigurationid":
|
|
110
|
+
case "--monitoring-configuration-id":
|
|
90
111
|
monitoringConfigurationId = args[++i];
|
|
91
112
|
break;
|
|
92
113
|
}
|
|
@@ -155,7 +176,6 @@ async function getMonitoringConfiguration(args) {
|
|
|
155
176
|
}
|
|
156
177
|
|
|
157
178
|
async function createMonitoringConfiguration(args) {
|
|
158
|
-
let company = undefined;
|
|
159
179
|
let name = undefined;
|
|
160
180
|
for (let i = 0; i < args.length - 1; i++) {
|
|
161
181
|
switch (args[i].toLowerCase()) {
|
|
@@ -179,6 +199,7 @@ async function listVCenterConfigurations(args) {
|
|
|
179
199
|
for (let i = 0; i < args.length - 1; i++) {
|
|
180
200
|
switch (args[i].toLowerCase()) {
|
|
181
201
|
case "--monitoringconfigurationid":
|
|
202
|
+
case "--monitoring-configuration-id":
|
|
182
203
|
id = args[++i];
|
|
183
204
|
break;
|
|
184
205
|
}
|
|
@@ -213,6 +234,7 @@ async function createVCenterConfiguration(args) {
|
|
|
213
234
|
for (let i = 0; i < args.length - 1; i++) {
|
|
214
235
|
switch (args[i].toLowerCase()) {
|
|
215
236
|
case "--monitoringconfigurationid":
|
|
237
|
+
case "--monitoring-configuration-id":
|
|
216
238
|
id = args[++i];
|
|
217
239
|
break;
|
|
218
240
|
case "--name":
|
|
@@ -310,6 +332,22 @@ async function getMsqlConfiguration(args) {
|
|
|
310
332
|
console.log(JSON.stringify(getMsqlConfig, null, 2));
|
|
311
333
|
}
|
|
312
334
|
|
|
335
|
+
async function getMssqlEntitlements(args) {
|
|
336
|
+
let company = undefined;
|
|
337
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
338
|
+
switch (args[i].toLowerCase()) {
|
|
339
|
+
case "--company":
|
|
340
|
+
company = args[++i];
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const client = await getOpsCompassClient();
|
|
346
|
+
const mssqlEntitlements = await client.licenseManager.getMssqlEntitlements(company);
|
|
347
|
+
|
|
348
|
+
console.log(JSON.stringify(mssqlEntitlements, null, 2));
|
|
349
|
+
}
|
|
350
|
+
|
|
313
351
|
async function createOracleDatabaseConfiguration(args) {
|
|
314
352
|
let id = undefined;
|
|
315
353
|
let name = undefined;
|
|
@@ -317,6 +355,7 @@ async function createOracleDatabaseConfiguration(args) {
|
|
|
317
355
|
for (let i = 0; i < args.length - 1; i++) {
|
|
318
356
|
switch (args[i].toLowerCase()) {
|
|
319
357
|
case "--monitoringconfigurationid":
|
|
358
|
+
case "--monitoring-configuration-id":
|
|
320
359
|
id = args[++i];
|
|
321
360
|
break;
|
|
322
361
|
case "--name":
|
|
@@ -342,7 +381,6 @@ async function updateMonitoringConfiguration(args) {
|
|
|
342
381
|
// Prep any arguments that are arrays
|
|
343
382
|
args = setArgumentArrays(["--mailFrom", "--emailTo"], args);
|
|
344
383
|
|
|
345
|
-
const callParams = {};
|
|
346
384
|
for (let i = 0; i < args.length - 1; i++) {
|
|
347
385
|
switch (args[i].toLowerCase()) {
|
|
348
386
|
case "--id":
|
|
@@ -387,7 +425,6 @@ async function updateMonitoringConfiguration(args) {
|
|
|
387
425
|
}
|
|
388
426
|
|
|
389
427
|
async function updateOracleDatabaseConfiguration(args) {
|
|
390
|
-
const callParams = {};
|
|
391
428
|
for (let i = 0; i < args.length - 1; i++) {
|
|
392
429
|
switch (args[i].toLowerCase()) {
|
|
393
430
|
case "--id":
|
|
@@ -456,8 +493,7 @@ async function updateOracleDatabaseConfigurations(args) {
|
|
|
456
493
|
|
|
457
494
|
|
|
458
495
|
async function updateVCenterConfiguration(args) {
|
|
459
|
-
|
|
460
|
-
};
|
|
496
|
+
|
|
461
497
|
for (let i = 0; i < args.length - 1; i++) {
|
|
462
498
|
switch (args[i].toLowerCase()) {
|
|
463
499
|
case "--id":
|
|
@@ -490,7 +526,6 @@ async function updateVCenterConfiguration(args) {
|
|
|
490
526
|
}
|
|
491
527
|
|
|
492
528
|
async function updateVCenterConfigurations(args) {
|
|
493
|
-
|
|
494
529
|
let callParamsArray = [];
|
|
495
530
|
let jsonIndex = args.indexOf('--json-updates')
|
|
496
531
|
let idIndex = args.indexOf('--id')
|
|
@@ -502,135 +537,338 @@ async function updateVCenterConfigurations(args) {
|
|
|
502
537
|
callParamsArray = JSON.parse(jsonString);
|
|
503
538
|
} else if (idIndex !== -1) {
|
|
504
539
|
/* If no '--json-update' flag, process bulk update with parameter flags (e.g. --id, --name, etc.) */
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
540
|
+
for(let i = 0; i < args.length - 1; i++) {
|
|
541
|
+
if(args[i] === '--id') {
|
|
542
|
+
/* Reset callParams object when a second id is encountered */
|
|
543
|
+
callParams = {
|
|
509
544
|
};
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
545
|
+
/* if theres an existing callParams object, toss it into the array and move on. */
|
|
546
|
+
callParamsArray.push(callParams)
|
|
547
|
+
/* Create the object's properties based on the index (e.g. if the index is --id, you'll find the value at the next index */
|
|
548
|
+
callParams.id = args[i + 1];
|
|
549
|
+
} else if(args[i].toLowerCase() === '--configurationname' || args[i].toLowerCase() === '--configuration-name' || args[i].toLowerCase() === "--name" ) {
|
|
550
|
+
callParams.configurationName = args[i + 1];
|
|
516
551
|
} else if(args[i].toLowerCase() === '--action') {
|
|
517
552
|
if (callParams.actions === undefined) callParams.actions = [];
|
|
518
553
|
callParams.actions.push(args[i + 1]);
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
} else {
|
|
528
|
-
console.warn("Invalid input, please see help for examples.")
|
|
529
|
-
return console.log("")
|
|
554
|
+
} else if(args[i.toLowerCase] === '--connection') {
|
|
555
|
+
callParams.connection = args[i + 1];
|
|
556
|
+
} else if(args[i.toLowerCase] === '--user') {
|
|
557
|
+
callParams.user = args[i + 1];
|
|
558
|
+
} else if(args[i.toLowerCase] === '--password') {
|
|
559
|
+
callParams.password = args[i + 1];
|
|
560
|
+
}
|
|
530
561
|
}
|
|
562
|
+
} else {
|
|
563
|
+
console.warn("Invalid input, please see help for examples.")
|
|
564
|
+
return console.log("")
|
|
565
|
+
}
|
|
531
566
|
|
|
532
567
|
/* Call the API and print to console */
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
const client = await getOpsCompassClient();
|
|
567
|
-
const msqlConfiguration = await client.licenseManager.updateMsqlConfiguration(callParams.id, callParams);
|
|
568
|
-
console.log(JSON.stringify(msqlConfiguration, null, 2));
|
|
568
|
+
const client = await getOpsCompassClient();
|
|
569
|
+
const vCenterConfigurations = await client.licenseManager.updateVCenterConfigurations(callParamsArray);
|
|
570
|
+
console.log(JSON.stringify(vCenterConfigurations, null, 2));
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
async function updateMsqlConfiguration(args) {
|
|
574
|
+
|
|
575
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
576
|
+
switch (args[i].toLowerCase()) {
|
|
577
|
+
case "--id":
|
|
578
|
+
callParams.id = args[++i];
|
|
579
|
+
break;
|
|
580
|
+
case "--name":
|
|
581
|
+
case "--configurationname":
|
|
582
|
+
case "--configuration-name":
|
|
583
|
+
callParams.configurationName = args[++i];
|
|
584
|
+
break;
|
|
585
|
+
case "--action":
|
|
586
|
+
if (callParams.actions === undefined) callParams.actions = [];
|
|
587
|
+
callParams.actions.push(args[++i]);
|
|
588
|
+
break;
|
|
589
|
+
case "--server":
|
|
590
|
+
callParams.server = args[++i];
|
|
591
|
+
break;
|
|
592
|
+
case "--user":
|
|
593
|
+
callParams.user = args[++i];
|
|
594
|
+
break;
|
|
595
|
+
case "--password":
|
|
596
|
+
callParams.password = args[++i];
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
569
599
|
}
|
|
600
|
+
const client = await getOpsCompassClient();
|
|
601
|
+
const msqlConfiguration = await client.licenseManager.updateMsqlConfiguration(callParams.id, callParams);
|
|
602
|
+
console.log(JSON.stringify(msqlConfiguration, null, 2));
|
|
603
|
+
}
|
|
570
604
|
|
|
571
605
|
|
|
572
|
-
|
|
606
|
+
async function updateMsqlConfigurations(args) {
|
|
573
607
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
/* If no '--json-updates' flag, process bulk update with parameter flags (e.g. --id, --name, etc.) */
|
|
585
|
-
} else if (idIndex !== -1) {
|
|
586
|
-
for(let i = 0; i < args.length - 1; i++) {
|
|
587
|
-
if(args[i] === '--id') {
|
|
588
|
-
/* Reset callParams object when a second id is encountered */
|
|
589
|
-
callParams = {
|
|
590
|
-
};
|
|
591
|
-
/* if theres an existing callParams object, toss it into the array and move on. */
|
|
592
|
-
callParamsArray.push(callParams)
|
|
593
|
-
/* Create the object's properties based on the index (e.g. if the index is --id, you'll find the value at the next index */
|
|
594
|
-
callParams.id = args[i + 1];
|
|
595
|
-
} else if(args[i].toLowerCase() === '--configurationname' || args[i].toLowerCase() === '--configuration-name' || args[i].toLowerCase() === "--name" ) {
|
|
596
|
-
callParams.configurationName = args[i + 1];
|
|
597
|
-
} else if(args[i].toLowerCase() === '--action') {
|
|
598
|
-
if (callParams.actions === undefined) callParams.actions = [];
|
|
599
|
-
callParams.actions.push(args[i + 1]);
|
|
600
|
-
} else if(args[i].toLowerCase() === '--server') {
|
|
601
|
-
callParams.server = args[i + 1];
|
|
602
|
-
} else if(args[i].toLowerCase() === '--user') {
|
|
603
|
-
callParams.user = args[i + 1];
|
|
604
|
-
} else if(args[i].toLowerCase() === '--password') {
|
|
605
|
-
callParams.password = args[i + 1];
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
} else {
|
|
609
|
-
console.warn("Invalid input, please see help for examples.")
|
|
610
|
-
return console.log("")
|
|
611
|
-
}
|
|
608
|
+
let callParamsArray = [];
|
|
609
|
+
let jsonIndex = args.indexOf('--json-updates')
|
|
610
|
+
let idIndex = args.indexOf('--id')
|
|
611
|
+
let callParams = {};
|
|
612
|
+
|
|
613
|
+
/* Process bulk update with JSON */
|
|
614
|
+
if (jsonIndex !== -1) {
|
|
615
|
+
const jsonString = args[jsonIndex + 1];
|
|
616
|
+
callParamsArray = JSON.parse(jsonString);
|
|
612
617
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
618
|
+
/* If no '--json-updates' flag, process bulk update with parameter flags (e.g. --id, --name, etc.) */
|
|
619
|
+
} else if (idIndex !== -1) {
|
|
620
|
+
for(let i = 0; i < args.length - 1; i++) {
|
|
621
|
+
if(args[i] === '--id') {
|
|
622
|
+
/* Reset callParams object when a second id is encountered */
|
|
623
|
+
callParams = {
|
|
624
|
+
};
|
|
625
|
+
/* if theres an existing callParams object, toss it into the array and move on. */
|
|
626
|
+
callParamsArray.push(callParams)
|
|
627
|
+
/* Create the object's properties based on the index (e.g. if the index is --id, you'll find the value at the next index */
|
|
628
|
+
callParams.id = args[i + 1];
|
|
629
|
+
} else if(args[i].toLowerCase() === '--configurationname' || args[i].toLowerCase() === '--configuration-name' || args[i].toLowerCase() === "--name" ) {
|
|
630
|
+
callParams.configurationName = args[i + 1];
|
|
631
|
+
} else if(args[i].toLowerCase() === '--action') {
|
|
632
|
+
if (callParams.actions === undefined) callParams.actions = [];
|
|
633
|
+
callParams.actions.push(args[i + 1]);
|
|
634
|
+
} else if(args[i].toLowerCase() === '--server') {
|
|
635
|
+
callParams.server = args[i + 1];
|
|
636
|
+
} else if(args[i].toLowerCase() === '--user') {
|
|
637
|
+
callParams.user = args[i + 1];
|
|
638
|
+
} else if(args[i].toLowerCase() === '--password') {
|
|
639
|
+
callParams.password = args[i + 1];
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
} else {
|
|
643
|
+
console.warn("Invalid input, please see help for examples.")
|
|
644
|
+
return console.log("")
|
|
627
645
|
}
|
|
628
646
|
|
|
647
|
+
/* Call the API and print to console */
|
|
629
648
|
const client = await getOpsCompassClient();
|
|
630
|
-
const
|
|
631
|
-
console.log(JSON.stringify(
|
|
649
|
+
const msqlConfigurations = await client.licenseManager.updateMsqlConfigurations(callParamsArray);
|
|
650
|
+
console.log(JSON.stringify(msqlConfigurations, null, 2));
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
async function getMssqlEntitlementComponents(args) {
|
|
654
|
+
let company = undefined;
|
|
655
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
656
|
+
switch (args[i].toLowerCase()) {
|
|
657
|
+
case "--company":
|
|
658
|
+
company = args[++i];
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
632
661
|
}
|
|
633
662
|
|
|
663
|
+
const client = await getOpsCompassClient();
|
|
664
|
+
const entitlementComponents = await client.licenseManager.getMssqlEntitlementComponents(company);
|
|
665
|
+
console.log(JSON.stringify(entitlementComponents, null, 2));
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
async function createMssqlEntitlement(args) {
|
|
669
|
+
let company = undefined;
|
|
670
|
+
let newRecord = {
|
|
671
|
+
purchaseDate: undefined,
|
|
672
|
+
quantity: undefined,
|
|
673
|
+
supportStart: undefined,
|
|
674
|
+
supportEnd: undefined,
|
|
675
|
+
msqlProduct: undefined,
|
|
676
|
+
msqlEdition: undefined,
|
|
677
|
+
msqlVersion: undefined,
|
|
678
|
+
msqlMetric: undefined
|
|
679
|
+
};
|
|
680
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
681
|
+
switch (args[i].toLowerCase()) {
|
|
682
|
+
case "--company":
|
|
683
|
+
company = args[++i];
|
|
684
|
+
break;
|
|
685
|
+
case "--purchase-date":
|
|
686
|
+
case "--purchasedate":
|
|
687
|
+
newRecord.purchaseDate = args[++i];
|
|
688
|
+
break;
|
|
689
|
+
case "--quantity":
|
|
690
|
+
newRecord.quantity = args[++i];
|
|
691
|
+
break;
|
|
692
|
+
case "--support-start":
|
|
693
|
+
case "--supportstart":
|
|
694
|
+
newRecord.supportStart = args[++i];
|
|
695
|
+
break;
|
|
696
|
+
case "--support-end":
|
|
697
|
+
case "--supportend":
|
|
698
|
+
newRecord.supportEnd = args[++i];
|
|
699
|
+
break;
|
|
700
|
+
case "--mssql-product":
|
|
701
|
+
case "--mssqlproduct":
|
|
702
|
+
newRecord.msqlProduct = args[++i];
|
|
703
|
+
break;
|
|
704
|
+
case "--mssql-edition":
|
|
705
|
+
case "--mssqledition":
|
|
706
|
+
newRecord.msqlEdition = args[++i];
|
|
707
|
+
break;
|
|
708
|
+
case "--mssql-version":
|
|
709
|
+
case "--mssqlversion":
|
|
710
|
+
newRecord.msqlVersion = args[++i];
|
|
711
|
+
break;
|
|
712
|
+
case "--mssql-metric":
|
|
713
|
+
case "--mssqlmetric":
|
|
714
|
+
newRecord.msqlMetric = args[++i];
|
|
715
|
+
break;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
const client = await getOpsCompassClient();
|
|
720
|
+
const response = await client.licenseManager.createMssqlEntitlements(company, [newRecord]);
|
|
721
|
+
console.log(JSON.stringify(response, null, 2));
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
async function updateMssqlEntitlement(args) {
|
|
725
|
+
let company = undefined;
|
|
726
|
+
let updateRecord = {
|
|
727
|
+
id: undefined,
|
|
728
|
+
purchaseDate: undefined,
|
|
729
|
+
quantity: undefined,
|
|
730
|
+
supportStart: undefined,
|
|
731
|
+
supportEnd: undefined,
|
|
732
|
+
msqlProduct: undefined,
|
|
733
|
+
msqlEdition: undefined,
|
|
734
|
+
msqlVersion: undefined,
|
|
735
|
+
msqlMetric: undefined
|
|
736
|
+
};
|
|
737
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
738
|
+
switch (args[i].toLowerCase()) {
|
|
739
|
+
case "--company":
|
|
740
|
+
company = args[++i];
|
|
741
|
+
break;
|
|
742
|
+
case "--id":
|
|
743
|
+
updateRecord.id = args[++i];
|
|
744
|
+
break;
|
|
745
|
+
case "--purchase-date":
|
|
746
|
+
case "--purchasedate":
|
|
747
|
+
updateRecord.purchaseDate = args[++i];
|
|
748
|
+
break;
|
|
749
|
+
case "--quantity":
|
|
750
|
+
updateRecord.quantity = args[++i];
|
|
751
|
+
break;
|
|
752
|
+
case "--support-start":
|
|
753
|
+
case "--supportstart":
|
|
754
|
+
updateRecord.supportStart = args[++i];
|
|
755
|
+
break;
|
|
756
|
+
case "--support-end":
|
|
757
|
+
case "--supportend":
|
|
758
|
+
updateRecord.supportEnd = args[++i];
|
|
759
|
+
break;
|
|
760
|
+
case "--mssql-product":
|
|
761
|
+
case "--mssqlproduct":
|
|
762
|
+
updateRecord.msqlProduct = args[++i];
|
|
763
|
+
break;
|
|
764
|
+
case "--mssql-edition":
|
|
765
|
+
case "--mssqledition":
|
|
766
|
+
updateRecord.msqlEdition = args[++i];
|
|
767
|
+
break;
|
|
768
|
+
case "--mssql-version":
|
|
769
|
+
case "--mssqlversion":
|
|
770
|
+
updateRecord.msqlVersion = args[++i];
|
|
771
|
+
break;
|
|
772
|
+
case "--mssql-metric":
|
|
773
|
+
case "--mssqlmetric":
|
|
774
|
+
updateRecord.msqlMetric = args[++i];
|
|
775
|
+
break;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
const client = await getOpsCompassClient();
|
|
780
|
+
const response = await client.licenseManager.updateMssqlEntitlements(company, [updateRecord]);
|
|
781
|
+
console.log(JSON.stringify(response, null, 2));
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
async function listMssqlAssessments(args){
|
|
785
|
+
let company = undefined;
|
|
786
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
787
|
+
switch (args[i].toLowerCase()) {
|
|
788
|
+
case "--company":
|
|
789
|
+
company = args[++i];
|
|
790
|
+
break;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const client = await getOpsCompassClient();
|
|
795
|
+
const response = await client.licenseManager.listMssqlAssessments(company);
|
|
796
|
+
|
|
797
|
+
console.log(JSON.stringify(response, null, 2));
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
async function getMssqlAssessment(args) {
|
|
801
|
+
let assessmentId = undefined;
|
|
802
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
803
|
+
switch (args[i].toLowerCase()) {
|
|
804
|
+
case "--assessmentId":
|
|
805
|
+
case "--id":
|
|
806
|
+
case "--assessmentid":
|
|
807
|
+
assessmentId = args[++i];
|
|
808
|
+
break;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
const client = await getOpsCompassClient();
|
|
813
|
+
const response = await client.licenseManager.getMssqlAssessment(assessmentId);
|
|
814
|
+
|
|
815
|
+
console.log(JSON.stringify(response, null, 2));
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
async function getMssqlAssessmentEntitlements(args) {
|
|
819
|
+
let assessmentId = undefined;
|
|
820
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
821
|
+
switch (args[i].toLowerCase()) {
|
|
822
|
+
case "--assessmentId":
|
|
823
|
+
case "--id":
|
|
824
|
+
case "--assessmentid":
|
|
825
|
+
assessmentId = args[++i];
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
const client = await getOpsCompassClient();
|
|
831
|
+
const response = await client.licenseManager.getMssqlAssessmentEntitlements(assessmentId);
|
|
832
|
+
|
|
833
|
+
console.log(JSON.stringify(response, null, 2));
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
async function getMssqlAssessmentLicenseUsageMaps(args) {
|
|
837
|
+
let assessmentId = undefined;
|
|
838
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
839
|
+
switch (args[i].toLowerCase()) {
|
|
840
|
+
case "--assessmentId":
|
|
841
|
+
case "--id":
|
|
842
|
+
case "--assessmentid":
|
|
843
|
+
assessmentId = args[++i];
|
|
844
|
+
break;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
const client = await getOpsCompassClient();
|
|
849
|
+
const response = await client.licenseManager.getMssqlAssessmentLicenseUsageMaps(assessmentId);
|
|
850
|
+
|
|
851
|
+
console.log(JSON.stringify(response, null, 2));
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
async function getMssqlAssessmentResources(args) {
|
|
855
|
+
let assessmentId = undefined;
|
|
856
|
+
for (let i = 0; i < args.length - 1; i++) {
|
|
857
|
+
switch (args[i].toLowerCase()) {
|
|
858
|
+
case "--assessmentId":
|
|
859
|
+
case "--id":
|
|
860
|
+
case "--assessmentid":
|
|
861
|
+
assessmentId = args[++i];
|
|
862
|
+
break;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
const client = await getOpsCompassClient();
|
|
867
|
+
const response = await client.licenseManager.getMssqlAssessmentResources(assessmentId);
|
|
868
|
+
|
|
869
|
+
console.log(JSON.stringify(response, null, 2));
|
|
870
|
+
}
|
|
871
|
+
|
|
634
872
|
async function printHelp() {
|
|
635
873
|
console.log("Actions available for license-manager:");
|
|
636
874
|
console.log();
|
|
@@ -655,7 +893,7 @@ async function printHelp() {
|
|
|
655
893
|
console.log();
|
|
656
894
|
console.log("list-oracle-database-configurations", "Lists all of the oracle database configurations associated with the given monitoring configuration");
|
|
657
895
|
console.log("Parameters:");
|
|
658
|
-
console.log("--
|
|
896
|
+
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
659
897
|
console.log();
|
|
660
898
|
console.log("get-oracle-database-configuration", "Get a single oracle database configuration associated with the given monitoring configuration");
|
|
661
899
|
console.log("Parameters:");
|
|
@@ -663,7 +901,7 @@ async function printHelp() {
|
|
|
663
901
|
console.log();
|
|
664
902
|
console.log("list-vcenter-configurations", "Lists all of the vcenter configurations associated with the given monitoring configuration");
|
|
665
903
|
console.log("Parameters:");
|
|
666
|
-
console.log("--
|
|
904
|
+
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
667
905
|
console.log();
|
|
668
906
|
console.log("get-vcenter-configuration", "Get a single vcenter configuration associated with the given monitoring configuration");
|
|
669
907
|
console.log("Parameters:");
|
|
@@ -671,7 +909,7 @@ async function printHelp() {
|
|
|
671
909
|
console.log();
|
|
672
910
|
console.log("create-vcenter-configuration", "Create a single vcenter configuration associated with the given monitoring configuration.");
|
|
673
911
|
console.log("Parameters:");
|
|
674
|
-
console.log("--
|
|
912
|
+
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
675
913
|
console.log("--name [unique name]");
|
|
676
914
|
console.log(`--action (optional) pass multiple times to define which actions this connection can take e.g. --action "skip" --action "vmotion"`);
|
|
677
915
|
console.log("--connection (optional) [the hostname or ip address]");
|
|
@@ -697,7 +935,7 @@ async function printHelp() {
|
|
|
697
935
|
console.log();
|
|
698
936
|
console.log("create-oracle-database-configuration", "Create a single oracle database configuration associated with the given monitoring configuration.");
|
|
699
937
|
console.log("Parameters:");
|
|
700
|
-
console.log("--
|
|
938
|
+
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
701
939
|
console.log("--name [unique name]");
|
|
702
940
|
console.log(`--action (optional) pass multiple times to define which actions this connection can take e.g. --action "skip" --action "dbcompliance"`);
|
|
703
941
|
console.log("--connectionString (optional) [the database connection string]");
|
|
@@ -801,10 +1039,76 @@ async function printHelp() {
|
|
|
801
1039
|
console.log("Parameters:");
|
|
802
1040
|
console.log("--company [company_slug]");
|
|
803
1041
|
console.log();
|
|
1042
|
+
console.log("create-mssql-entitlement", "Creates a Mssql Entitlement record.");
|
|
1043
|
+
console.log("Parameters:");
|
|
1044
|
+
console.log("--company [company_slug]");
|
|
1045
|
+
console.log("--purchase-date [Date] the date of purchase.");
|
|
1046
|
+
console.log("Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.");
|
|
1047
|
+
console.log("--quantity [number] the number for this entry");
|
|
1048
|
+
console.log("--support-start (optional) [Date] the date when support started");
|
|
1049
|
+
console.log("Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.");
|
|
1050
|
+
console.log("--support-end (optional) [Date] the date when support ended");
|
|
1051
|
+
console.log("Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.");
|
|
1052
|
+
console.log("--mssql-product [string] the slug of the associated mssql product");
|
|
1053
|
+
console.log("--mssql-edition [string] the slug of the associated mssql edition");
|
|
1054
|
+
console.log("--mssql-version [string] the slug of the associated mssql version");
|
|
1055
|
+
console.log("--mssql-metric [string] the slug of the associated mssql metric");
|
|
1056
|
+
console.log();
|
|
1057
|
+
console.log("update-mssql-entitlement", "Creates a Mssql Entitlement record.");
|
|
1058
|
+
console.log("Parameters:");
|
|
1059
|
+
console.log("--company [company_slug]");
|
|
1060
|
+
console.log("--id [number] the mssql entitlement record id");
|
|
1061
|
+
console.log("--purchase-date [Date] the date of purchase.");
|
|
1062
|
+
console.log("Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.");
|
|
1063
|
+
console.log("--quantity [number] the number for this entry");
|
|
1064
|
+
console.log("--support-start (optional) [Date] the date when support started");
|
|
1065
|
+
console.log("Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.");
|
|
1066
|
+
console.log("--support-end (optional) [Date] the date when support ended");
|
|
1067
|
+
console.log("Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.");
|
|
1068
|
+
console.log("--mssql-product [string] the slug of the associated mssql product");
|
|
1069
|
+
console.log("--mssql-edition [string] the slug of the associated mssql edition");
|
|
1070
|
+
console.log("--mssql-version [string] the slug of the associated mssql version");
|
|
1071
|
+
console.log("--mssql-metric [string] the slug of the associated mssql metric");
|
|
1072
|
+
console.log();
|
|
1073
|
+
console.log("delete-mssql-entitlements", "Deletes Mssql Entitlement records.");
|
|
1074
|
+
console.log("Parameters:");
|
|
1075
|
+
console.log("--company [string] The slug of the company.");
|
|
1076
|
+
console.log("--id [string] Use parameter multiple times to delete multiple records.");
|
|
1077
|
+
console.log();
|
|
1078
|
+
console.log("list-mssql-assessments", "Lists MSSQL Assessments")
|
|
1079
|
+
console.log("Parameters:");
|
|
1080
|
+
console.log("--company [string] The slug of the company.");
|
|
1081
|
+
console.log();
|
|
1082
|
+
console.log("get-mssql-assessment", "Get Full MSSQL Assessment")
|
|
1083
|
+
console.log("Parameters:");
|
|
1084
|
+
console.log("--assessmentId [number] The id of the assessment to retrieve.");
|
|
1085
|
+
console.log();
|
|
1086
|
+
console.log("get-mssql-assessment-entitlements", "Gets Entitlements for an MSSQL Assessment")
|
|
1087
|
+
console.log("Parameters:");
|
|
1088
|
+
console.log("--assessmentId [number] The id of the assessment to retrieve.");
|
|
1089
|
+
console.log();
|
|
1090
|
+
console.log("get-mssql-assessment-license-usage-maps", "Gets LicenseUsageMaps for an MSSQL Assessment")
|
|
1091
|
+
console.log("Parameters:");
|
|
1092
|
+
console.log("--assessmentId [number] The id of the assessment to retrieve.");
|
|
1093
|
+
console.log();
|
|
1094
|
+
console.log("get-mssql-assessment-resources", "Gets Resources for an MSSQL Assessment")
|
|
1095
|
+
console.log("Parameters:");
|
|
1096
|
+
console.log("--assessmentId [number] The id of the assessment to retrieve.");
|
|
1097
|
+
console.log();
|
|
804
1098
|
}
|
|
805
1099
|
|
|
806
1100
|
const licenseManagerModule = (action, ...args) => {
|
|
807
1101
|
switch (action?.toLowerCase() ?? "") {
|
|
1102
|
+
case 'list-mssql-assessments':
|
|
1103
|
+
return listMssqlAssessments(args);
|
|
1104
|
+
case 'get-mssql-assessment':
|
|
1105
|
+
return getMssqlAssessment(args);
|
|
1106
|
+
case 'get-mssql-assessment-entitlements':
|
|
1107
|
+
return getMssqlAssessmentEntitlements(args);
|
|
1108
|
+
case 'get-mssql-assessment-license-usage-maps':
|
|
1109
|
+
return getMssqlAssessmentLicenseUsageMaps(args);
|
|
1110
|
+
case 'get-mssql-assessment-resources':
|
|
1111
|
+
return getMssqlAssessmentResources(args);
|
|
808
1112
|
case "get-secret-for-configuration":
|
|
809
1113
|
return getSecretForConfiguration(args);
|
|
810
1114
|
case "list-monitoring-configurations":
|
|
@@ -825,6 +1129,8 @@ const licenseManagerModule = (action, ...args) => {
|
|
|
825
1129
|
return createMsqlConfiguration(args);
|
|
826
1130
|
case "get-msql-configuration":
|
|
827
1131
|
return getMsqlConfiguration(args);
|
|
1132
|
+
case "get-mssql-entitlements":
|
|
1133
|
+
return getMssqlEntitlements(args);
|
|
828
1134
|
case "get-oracle-database-configuration":
|
|
829
1135
|
return getOracleDatabaseConfiguration(args);
|
|
830
1136
|
case "list-oracle-database-configurations":
|
|
@@ -855,6 +1161,12 @@ const licenseManagerModule = (action, ...args) => {
|
|
|
855
1161
|
return updateMsqlConfigurations(args);
|
|
856
1162
|
case "get-mssql-entitlement-components":
|
|
857
1163
|
return getMssqlEntitlementComponents(args);
|
|
1164
|
+
case "create-mssql-entitlement":
|
|
1165
|
+
return createMssqlEntitlement(args);
|
|
1166
|
+
case "update-mssql-entitlement":
|
|
1167
|
+
return updateMssqlEntitlement(args);
|
|
1168
|
+
case "delete-mssql-entitlements":
|
|
1169
|
+
return deleteMssqlEntitlements(args);
|
|
858
1170
|
case "help":
|
|
859
1171
|
case "":
|
|
860
1172
|
return printHelp();
|