@opscompass/opscompass-cli 1.0.47 → 1.3.2
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/colors.js +5 -5
- package/credentials.js +20 -29
- package/environment/current.js +6 -6
- package/environment/demo.js +6 -6
- package/environment/dev.js +6 -6
- package/environment/local.js +6 -6
- package/environment/production.js +6 -6
- package/error.js +1 -1
- package/index.js +20 -20
- package/lib/cliHelpers.js +34 -15
- package/lib/consts.js +2 -11
- package/lib/homeInteraction.js +21 -22
- package/lib/maskValues.js +17 -17
- package/lib/parseMetrics.js +25 -21
- package/lib/pgpTools.js +8 -10
- package/lib/utils.js +18 -22
- package/login.js +90 -40
- package/modules/accounts.js +32 -26
- package/modules/compliance.js +75 -76
- package/modules/data-gathering-scripts.js +41 -41
- package/modules/defaults.js +12 -12
- package/modules/expiration-info.js +54 -25
- package/modules/license-manager/microsoft.js +95 -72
- package/modules/license-manager/nutanix.js +31 -22
- package/modules/license-manager/vcenter.js +31 -22
- package/modules/license-manager.js +89 -91
- package/modules/resources.js +140 -70
- package/modules.js +31 -15
- package/oauth.js +2 -2
- package/opscompass.js +8 -9
- package/package.json +3 -2
- package/updates.js +9 -11
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getOpsCompassClient } from "../../opscompass.js";
|
|
2
|
+
import { utilsModule as utils } from "../../lib/utils.js";
|
|
3
|
+
import maskValues from "../../lib/maskValues.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @module license-manager:microsoft
|
|
7
7
|
* @description License Manager Microsoft module for OpsCompass CLI
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { createMaskedConfig, updateMaskedConfig } from "./maskedConfig.js";
|
|
11
11
|
|
|
12
12
|
async function deleteMssqlEntitlements(args) {
|
|
13
13
|
args = setArgumentArrays(["--id"], args);
|
|
@@ -24,7 +24,7 @@ async function deleteMssqlEntitlements(args) {
|
|
|
24
24
|
const client = await getOpsCompassClient();
|
|
25
25
|
const response = await client.licenseManager.mssql.deleteMssqlEntitlements(
|
|
26
26
|
global.company,
|
|
27
|
-
recordIds
|
|
27
|
+
recordIds,
|
|
28
28
|
);
|
|
29
29
|
console.log(JSON.stringify(response, null, 2));
|
|
30
30
|
}
|
|
@@ -79,7 +79,7 @@ async function createMssqlEntitlement(args) {
|
|
|
79
79
|
const client = await getOpsCompassClient();
|
|
80
80
|
const response = await client.licenseManager.mssql.createMssqlEntitlements(
|
|
81
81
|
global.company,
|
|
82
|
-
[newRecord]
|
|
82
|
+
[newRecord],
|
|
83
83
|
);
|
|
84
84
|
console.log(JSON.stringify(response, null, 2));
|
|
85
85
|
}
|
|
@@ -137,7 +137,7 @@ async function updateMssqlEntitlement(args) {
|
|
|
137
137
|
const client = await getOpsCompassClient();
|
|
138
138
|
const response = await client.licenseManager.mssql.updateMssqlEntitlements(
|
|
139
139
|
global.company,
|
|
140
|
-
[updateRecord]
|
|
140
|
+
[updateRecord],
|
|
141
141
|
);
|
|
142
142
|
console.log(JSON.stringify(response, null, 2));
|
|
143
143
|
}
|
|
@@ -154,7 +154,7 @@ async function getMssqlEntitlementComponents(args) {
|
|
|
154
154
|
const client = await getOpsCompassClient();
|
|
155
155
|
const entitlementComponents =
|
|
156
156
|
await client.licenseManager.mssql.getMssqlEntitlementComponents(
|
|
157
|
-
global.company
|
|
157
|
+
global.company,
|
|
158
158
|
);
|
|
159
159
|
console.log(JSON.stringify(entitlementComponents, null, 2));
|
|
160
160
|
}
|
|
@@ -162,7 +162,7 @@ async function getMssqlEntitlementComponents(args) {
|
|
|
162
162
|
async function listMssqlAssessments(args) {
|
|
163
163
|
const client = await getOpsCompassClient();
|
|
164
164
|
const response = await client.licenseManager.mssql.listMssqlAssessments(
|
|
165
|
-
global.company
|
|
165
|
+
global.company,
|
|
166
166
|
);
|
|
167
167
|
|
|
168
168
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -181,9 +181,8 @@ async function getMssqlAssessment(args) {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
const client = await getOpsCompassClient();
|
|
184
|
-
const response =
|
|
185
|
-
assessmentId
|
|
186
|
-
);
|
|
184
|
+
const response =
|
|
185
|
+
await client.licenseManager.mssql.getMssqlAssessment(assessmentId);
|
|
187
186
|
|
|
188
187
|
console.log(JSON.stringify(response, null, 2));
|
|
189
188
|
}
|
|
@@ -203,7 +202,7 @@ async function getMssqlAssessmentEntitlements(args) {
|
|
|
203
202
|
const client = await getOpsCompassClient();
|
|
204
203
|
const response =
|
|
205
204
|
await client.licenseManager.mssql.getMssqlAssessmentEntitlements(
|
|
206
|
-
assessmentId
|
|
205
|
+
assessmentId,
|
|
207
206
|
);
|
|
208
207
|
|
|
209
208
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -224,7 +223,7 @@ async function getMssqlAssessmentLicenseUsageMaps(args) {
|
|
|
224
223
|
const client = await getOpsCompassClient();
|
|
225
224
|
const response =
|
|
226
225
|
await client.licenseManager.mssql.getMssqlAssessmentLicenseUsageMaps(
|
|
227
|
-
assessmentId
|
|
226
|
+
assessmentId,
|
|
228
227
|
);
|
|
229
228
|
|
|
230
229
|
console.log(JSON.stringify(response, null, 2));
|
|
@@ -267,7 +266,7 @@ async function checkMssqlConfigMetadata(args) {
|
|
|
267
266
|
const response = await client.licenseManager.mssql.checkMssqlConfigMetadata(
|
|
268
267
|
callParams.accountId,
|
|
269
268
|
global.company,
|
|
270
|
-
callParams.lastCollectedBefore
|
|
269
|
+
callParams.lastCollectedBefore,
|
|
271
270
|
);
|
|
272
271
|
console.log(JSON.stringify(response, null, 2));
|
|
273
272
|
}
|
|
@@ -276,7 +275,7 @@ async function getMssqlDefaultCredential(args) {
|
|
|
276
275
|
const client = await getOpsCompassClient();
|
|
277
276
|
const getResponse =
|
|
278
277
|
await client.licenseManager.mssql.getMssqlDefaultCredential(
|
|
279
|
-
global.monitoringConfig
|
|
278
|
+
global.monitoringConfig,
|
|
280
279
|
);
|
|
281
280
|
|
|
282
281
|
console.log(JSON.stringify(getResponse, null, 2));
|
|
@@ -307,7 +306,7 @@ async function createMssqlSharedCredential(args) {
|
|
|
307
306
|
const createResponse =
|
|
308
307
|
await client.licenseManager.mssql.createMssqlSharedCredential(
|
|
309
308
|
global.monitoringConfig,
|
|
310
|
-
optionalParams
|
|
309
|
+
optionalParams,
|
|
311
310
|
);
|
|
312
311
|
|
|
313
312
|
console.log(JSON.stringify(createResponse, null, 2));
|
|
@@ -361,7 +360,7 @@ async function updateMssqlSharedCredential(args) {
|
|
|
361
360
|
const updateResponse =
|
|
362
361
|
await client.licenseManager.mssql.updateMssqlSharedCredential(
|
|
363
362
|
id,
|
|
364
|
-
optionalParams
|
|
363
|
+
optionalParams,
|
|
365
364
|
);
|
|
366
365
|
|
|
367
366
|
console.log(JSON.stringify(updateResponse, null, 2));
|
|
@@ -378,9 +377,8 @@ async function deleteMssqlConfiguration(args) {
|
|
|
378
377
|
}
|
|
379
378
|
|
|
380
379
|
const client = await getOpsCompassClient();
|
|
381
|
-
const response =
|
|
382
|
-
id
|
|
383
|
-
);
|
|
380
|
+
const response =
|
|
381
|
+
await client.licenseManager.mssql.deleteMssqlConfiguration(id);
|
|
384
382
|
|
|
385
383
|
console.log(JSON.stringify(response, null, 2));
|
|
386
384
|
}
|
|
@@ -389,7 +387,7 @@ async function listMssqlConfigurations(args) {
|
|
|
389
387
|
const client = await getOpsCompassClient();
|
|
390
388
|
const listMssqlConfigs =
|
|
391
389
|
await client.licenseManager.mssql.listMssqlConfigurations(
|
|
392
|
-
global.monitoringConfig
|
|
390
|
+
global.monitoringConfig,
|
|
393
391
|
);
|
|
394
392
|
|
|
395
393
|
console.log(JSON.stringify(listMssqlConfigs, null, 2));
|
|
@@ -439,7 +437,7 @@ async function createMssqlConfiguration(args) {
|
|
|
439
437
|
const msqlConfiguration = await createMaskedConfig(
|
|
440
438
|
arguments.callee.name,
|
|
441
439
|
configurationName,
|
|
442
|
-
optionalParams
|
|
440
|
+
optionalParams,
|
|
443
441
|
);
|
|
444
442
|
console.log(JSON.stringify(msqlConfiguration, null, 2));
|
|
445
443
|
}
|
|
@@ -499,7 +497,7 @@ async function updateMssqlConfiguration(args) {
|
|
|
499
497
|
const msqlConfiguration = await updateMaskedConfig(
|
|
500
498
|
arguments.callee.name,
|
|
501
499
|
callParams.id,
|
|
502
|
-
callParams
|
|
500
|
+
callParams,
|
|
503
501
|
);
|
|
504
502
|
console.log(JSON.stringify(msqlConfiguration, null, 2));
|
|
505
503
|
}
|
|
@@ -516,7 +514,7 @@ async function updateMssqlConfigurations(args) {
|
|
|
516
514
|
if (!jsonString) {
|
|
517
515
|
if (process.stdin.isTTY) {
|
|
518
516
|
console.error(
|
|
519
|
-
"No JSON Microsoft DB string provided as argument or stdin"
|
|
517
|
+
"No JSON Microsoft DB string provided as argument or stdin",
|
|
520
518
|
);
|
|
521
519
|
return console.log("");
|
|
522
520
|
}
|
|
@@ -576,7 +574,7 @@ async function updateMssqlConfigurations(args) {
|
|
|
576
574
|
const client = await getOpsCompassClient();
|
|
577
575
|
const msqlConfigurations =
|
|
578
576
|
await client.licenseManager.mssql.updateMssqlConfigurations(
|
|
579
|
-
callParamsArray
|
|
577
|
+
callParamsArray,
|
|
580
578
|
);
|
|
581
579
|
console.log(JSON.stringify(msqlConfigurations, null, 2));
|
|
582
580
|
}
|
|
@@ -584,10 +582,10 @@ async function updateMssqlConfigurations(args) {
|
|
|
584
582
|
async function printMssqlHelp() {
|
|
585
583
|
console.log(
|
|
586
584
|
"create-mssql-shared-credential",
|
|
587
|
-
"Creates MS SQL shared credentials"
|
|
585
|
+
"Creates MS SQL shared credentials",
|
|
588
586
|
);
|
|
589
587
|
console.log(
|
|
590
|
-
"--monitoring-configuration-id monitoring configuration ID to make the shared credentials for"
|
|
588
|
+
"--monitoring-configuration-id monitoring configuration ID to make the shared credentials for",
|
|
591
589
|
);
|
|
592
590
|
console.log("--user (optional) [string]");
|
|
593
591
|
console.log("--password (optional) [string]");
|
|
@@ -595,21 +593,21 @@ async function printMssqlHelp() {
|
|
|
595
593
|
console.log();
|
|
596
594
|
console.log(
|
|
597
595
|
"delete-mssql-shared-credential",
|
|
598
|
-
"Delete a MS SQL shared credential"
|
|
596
|
+
"Delete a MS SQL shared credential",
|
|
599
597
|
);
|
|
600
598
|
console.log("--id ID of the mssql shared credential to delete");
|
|
601
599
|
console.log();
|
|
602
600
|
console.log(
|
|
603
601
|
"get-mssql-default-credential",
|
|
604
|
-
"Get MS SQL default credential record"
|
|
602
|
+
"Get MS SQL default credential record",
|
|
605
603
|
);
|
|
606
604
|
console.log(
|
|
607
|
-
"--monitoring-configuration-id monitoring configuration ID to get the default credentials for"
|
|
605
|
+
"--monitoring-configuration-id monitoring configuration ID to get the default credentials for",
|
|
608
606
|
);
|
|
609
607
|
console.log();
|
|
610
608
|
console.log(
|
|
611
609
|
"update-mssql-shared-credential",
|
|
612
|
-
"Update MS SQL shared credential record"
|
|
610
|
+
"Update MS SQL shared credential record",
|
|
613
611
|
);
|
|
614
612
|
console.log("--id ID of the mssql shared credential to update");
|
|
615
613
|
console.log("--user (optional) [string]");
|
|
@@ -618,20 +616,20 @@ async function printMssqlHelp() {
|
|
|
618
616
|
console.log();
|
|
619
617
|
console.log(
|
|
620
618
|
"list-mssql-configurations",
|
|
621
|
-
"Lists all of the mssql configurations associated with the given monitoring configuration"
|
|
619
|
+
"Lists all of the mssql configurations associated with the given monitoring configuration",
|
|
622
620
|
);
|
|
623
621
|
console.log("Parameters:");
|
|
624
622
|
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
625
623
|
console.log();
|
|
626
624
|
console.log(
|
|
627
625
|
"create-mssql-configuration",
|
|
628
|
-
"Create a single mssql configuration associated with the given monitoring configuration."
|
|
626
|
+
"Create a single mssql configuration associated with the given monitoring configuration.",
|
|
629
627
|
);
|
|
630
628
|
console.log("Parameters:");
|
|
631
629
|
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
632
630
|
console.log("--name or --configuration-name [unique name]");
|
|
633
631
|
console.log(
|
|
634
|
-
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "dbcompliance"
|
|
632
|
+
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "dbcompliance"`,
|
|
635
633
|
);
|
|
636
634
|
console.log("--server (optional) [the hostname or ip address]");
|
|
637
635
|
console.log("--user (optional) [server username]");
|
|
@@ -640,20 +638,20 @@ async function printMssqlHelp() {
|
|
|
640
638
|
console.log();
|
|
641
639
|
console.log(
|
|
642
640
|
"get-mssql-configuration",
|
|
643
|
-
"Get a single mssql configuration associated with the given monitoring configuration"
|
|
641
|
+
"Get a single mssql configuration associated with the given monitoring configuration",
|
|
644
642
|
);
|
|
645
643
|
console.log("Parameters:");
|
|
646
644
|
console.log("--id [mssql_configuration_id]");
|
|
647
645
|
console.log();
|
|
648
646
|
console.log(
|
|
649
647
|
"create-oracle-database-configuration",
|
|
650
|
-
"Create a single oracle database configuration associated with the given monitoring configuration."
|
|
648
|
+
"Create a single oracle database configuration associated with the given monitoring configuration.",
|
|
651
649
|
);
|
|
652
650
|
console.log("Parameters:");
|
|
653
651
|
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
654
652
|
console.log("--configuration-name [unique name]");
|
|
655
653
|
console.log(
|
|
656
|
-
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "dbcompliance"
|
|
654
|
+
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "dbcompliance"`,
|
|
657
655
|
);
|
|
658
656
|
console.log("--user (optional) [user to use for connection]");
|
|
659
657
|
console.log("--password (optional) [password to use for connection]");
|
|
@@ -665,13 +663,13 @@ async function printMssqlHelp() {
|
|
|
665
663
|
console.log();
|
|
666
664
|
console.log(
|
|
667
665
|
"update-mssql-configuration",
|
|
668
|
-
"Update a single mssql configuration."
|
|
666
|
+
"Update a single mssql configuration.",
|
|
669
667
|
);
|
|
670
668
|
console.log("Parameters:");
|
|
671
669
|
console.log("--id [configuration id]");
|
|
672
670
|
console.log("--name or --configuration-name (optional) [unique name]");
|
|
673
671
|
console.log(
|
|
674
|
-
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'dblicensing'"
|
|
672
|
+
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'dblicensing'",
|
|
675
673
|
);
|
|
676
674
|
console.log("--server (optional) [the server]");
|
|
677
675
|
console.log("--user (optional) [server username]");
|
|
@@ -681,13 +679,13 @@ async function printMssqlHelp() {
|
|
|
681
679
|
console.log();
|
|
682
680
|
console.log(
|
|
683
681
|
"update-mssql-configurations",
|
|
684
|
-
"Bulk Update MS SQL Configurations."
|
|
682
|
+
"Bulk Update MS SQL Configurations.",
|
|
685
683
|
);
|
|
686
684
|
console.log("Parameters:");
|
|
687
685
|
console.log("--id [configuration id]");
|
|
688
686
|
console.log("--name or --configuration-name (optional) [unique name]");
|
|
689
687
|
console.log(
|
|
690
|
-
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'dblicensing'"
|
|
688
|
+
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'dblicensing'",
|
|
691
689
|
);
|
|
692
690
|
console.log("--server (optional) [the server]");
|
|
693
691
|
console.log("--user (optional) [server username]");
|
|
@@ -696,99 +694,99 @@ async function printMssqlHelp() {
|
|
|
696
694
|
console.log("OR --json-updates [stringified json objects with your updates]");
|
|
697
695
|
console.log("For quick updates, you may use the above parameters");
|
|
698
696
|
console.log(
|
|
699
|
-
`e.g. opscompass license-manager update-mssql-configurations --id 31 --name "newname" --server "233.533.343" --user "joe" --action "skip" --id 25 --name "secondname" --action "skip" --action "dblicensing"
|
|
697
|
+
`e.g. opscompass license-manager update-mssql-configurations --id 31 --name "newname" --server "233.533.343" --user "joe" --action "skip" --id 25 --name "secondname" --action "skip" --action "dblicensing"`,
|
|
700
698
|
);
|
|
701
699
|
console.log(
|
|
702
|
-
"For larger updates, JavaScript Object Notation (JSON) may be used with the --json-updates flag"
|
|
700
|
+
"For larger updates, JavaScript Object Notation (JSON) may be used with the --json-updates flag",
|
|
703
701
|
);
|
|
704
702
|
console.log(
|
|
705
|
-
`e.g. opscompass license-manager update-mssql-configurations --json-updates '[{\"id\":\"25\",\"configurationName\":\"25\", \"server\":\"100.232.2423\", \"user\":\"tony\", \"actions\":[\"skip\", \"dblicensing\"]}, {\"id\":\"31\",\"configurationName\":\"31\", \"server\":\"100.232.2423\", \"user\":\"tony\", \"actions\":[\"skip\", \"dblicensing\"]}]'
|
|
703
|
+
`e.g. opscompass license-manager update-mssql-configurations --json-updates '[{\"id\":\"25\",\"configurationName\":\"25\", \"server\":\"100.232.2423\", \"user\":\"tony\", \"actions\":[\"skip\", \"dblicensing\"]}, {\"id\":\"31\",\"configurationName\":\"31\", \"server\":\"100.232.2423\", \"user\":\"tony\", \"actions\":[\"skip\", \"dblicensing\"]}]'`,
|
|
706
704
|
);
|
|
707
705
|
console.log();
|
|
708
706
|
console.log(
|
|
709
707
|
"get-mssql-entitlement-components",
|
|
710
|
-
"Gets the components that can be used to build MSSql entitlement objects."
|
|
708
|
+
"Gets the components that can be used to build MSSql entitlement objects.",
|
|
711
709
|
);
|
|
712
710
|
console.log("Parameters:");
|
|
713
711
|
console.log(`--company [company_slug] (default: ${global.company})\n`);
|
|
714
712
|
console.log();
|
|
715
713
|
console.log(
|
|
716
714
|
"create-mssql-entitlement",
|
|
717
|
-
"Creates a Mssql Entitlement record."
|
|
715
|
+
"Creates a Mssql Entitlement record.",
|
|
718
716
|
);
|
|
719
717
|
console.log("Parameters:");
|
|
720
718
|
console.log(`--company [company_slug] (default: ${global.company})\n`);
|
|
721
719
|
console.log("--purchase-date [Date] the date of purchase.");
|
|
722
720
|
console.log(
|
|
723
|
-
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC."
|
|
721
|
+
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.",
|
|
724
722
|
);
|
|
725
723
|
console.log("--quantity [number] the number for this entry");
|
|
726
724
|
console.log(
|
|
727
|
-
"--support-start (optional) [Date] the date when support started"
|
|
725
|
+
"--support-start (optional) [Date] the date when support started",
|
|
728
726
|
);
|
|
729
727
|
console.log(
|
|
730
|
-
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC."
|
|
728
|
+
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.",
|
|
731
729
|
);
|
|
732
730
|
console.log("--support-end (optional) [Date] the date when support ended");
|
|
733
731
|
console.log(
|
|
734
|
-
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC."
|
|
732
|
+
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.",
|
|
735
733
|
);
|
|
736
734
|
console.log(
|
|
737
|
-
"--mssql-product [string] the slug of the associated mssql product"
|
|
735
|
+
"--mssql-product [string] the slug of the associated mssql product",
|
|
738
736
|
);
|
|
739
737
|
console.log(
|
|
740
|
-
"--mssql-edition [string] the slug of the associated mssql edition"
|
|
738
|
+
"--mssql-edition [string] the slug of the associated mssql edition",
|
|
741
739
|
);
|
|
742
740
|
console.log(
|
|
743
|
-
"--mssql-version [string] the slug of the associated mssql version"
|
|
741
|
+
"--mssql-version [string] the slug of the associated mssql version",
|
|
744
742
|
);
|
|
745
743
|
console.log(
|
|
746
|
-
"--mssql-metric [string] the slug of the associated mssql metric"
|
|
744
|
+
"--mssql-metric [string] the slug of the associated mssql metric",
|
|
747
745
|
);
|
|
748
746
|
console.log();
|
|
749
747
|
console.log(
|
|
750
748
|
"update-mssql-entitlement",
|
|
751
|
-
"Creates a Mssql Entitlement record."
|
|
749
|
+
"Creates a Mssql Entitlement record.",
|
|
752
750
|
);
|
|
753
751
|
console.log("Parameters:");
|
|
754
752
|
console.log(`--company [company_slug] (default: ${global.company})\n`);
|
|
755
753
|
console.log("--id [number] the mssql entitlement record id");
|
|
756
754
|
console.log("--purchase-date [Date] the date of purchase.");
|
|
757
755
|
console.log(
|
|
758
|
-
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC."
|
|
756
|
+
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.",
|
|
759
757
|
);
|
|
760
758
|
console.log("--quantity [number] the number for this entry");
|
|
761
759
|
console.log(
|
|
762
|
-
"--support-start (optional) [Date] the date when support started"
|
|
760
|
+
"--support-start (optional) [Date] the date when support started",
|
|
763
761
|
);
|
|
764
762
|
console.log(
|
|
765
|
-
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC."
|
|
763
|
+
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.",
|
|
766
764
|
);
|
|
767
765
|
console.log("--support-end (optional) [Date] the date when support ended");
|
|
768
766
|
console.log(
|
|
769
|
-
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC."
|
|
767
|
+
"Format: UTC, example: '2022-08-23T17:00:00Z' to set August 8th, 2022 at 17:00 UTC.",
|
|
770
768
|
);
|
|
771
769
|
console.log(
|
|
772
|
-
"--mssql-product [string] the slug of the associated mssql product"
|
|
770
|
+
"--mssql-product [string] the slug of the associated mssql product",
|
|
773
771
|
);
|
|
774
772
|
console.log(
|
|
775
|
-
"--mssql-edition [string] the slug of the associated mssql edition"
|
|
773
|
+
"--mssql-edition [string] the slug of the associated mssql edition",
|
|
776
774
|
);
|
|
777
775
|
console.log(
|
|
778
|
-
"--mssql-version [string] the slug of the associated mssql version"
|
|
776
|
+
"--mssql-version [string] the slug of the associated mssql version",
|
|
779
777
|
);
|
|
780
778
|
console.log(
|
|
781
|
-
"--mssql-metric [string] the slug of the associated mssql metric"
|
|
779
|
+
"--mssql-metric [string] the slug of the associated mssql metric",
|
|
782
780
|
);
|
|
783
781
|
console.log();
|
|
784
782
|
console.log(
|
|
785
783
|
"delete-mssql-entitlements",
|
|
786
|
-
"Deletes Mssql Entitlement records."
|
|
784
|
+
"Deletes Mssql Entitlement records.",
|
|
787
785
|
);
|
|
788
786
|
console.log("Parameters:");
|
|
789
787
|
console.log(`--company [company_slug] (default: ${global.company})\n`);
|
|
790
788
|
console.log(
|
|
791
|
-
"--id [string] Use parameter multiple times to delete multiple records."
|
|
789
|
+
"--id [string] Use parameter multiple times to delete multiple records.",
|
|
792
790
|
);
|
|
793
791
|
console.log();
|
|
794
792
|
console.log("list-mssql-assessments", "Lists MSSQL Assessments");
|
|
@@ -801,38 +799,63 @@ async function printMssqlHelp() {
|
|
|
801
799
|
console.log();
|
|
802
800
|
console.log(
|
|
803
801
|
"get-mssql-assessment-entitlements",
|
|
804
|
-
"Gets Entitlements for an MSSQL Assessment"
|
|
802
|
+
"Gets Entitlements for an MSSQL Assessment",
|
|
805
803
|
);
|
|
806
804
|
console.log("Parameters:");
|
|
807
805
|
console.log("--assessmentId [number] The id of the assessment to retrieve.");
|
|
808
806
|
console.log();
|
|
809
807
|
console.log(
|
|
810
808
|
"(DEPRECATED) get-mssql-assessment-license-usage-maps",
|
|
811
|
-
"Gets LicenseUsageMaps for an MSSQL Assessment"
|
|
809
|
+
"Gets LicenseUsageMaps for an MSSQL Assessment",
|
|
812
810
|
);
|
|
813
811
|
console.log("Parameters:");
|
|
814
812
|
console.log("--assessmentId [number] The id of the assessment to retrieve.");
|
|
815
813
|
console.log();
|
|
816
814
|
console.log(
|
|
817
815
|
"(DEPRECATED) get-mssql-assessment-resources",
|
|
818
|
-
"Gets Resources for an MSSQL Assessment"
|
|
816
|
+
"Gets Resources for an MSSQL Assessment",
|
|
819
817
|
);
|
|
820
818
|
console.log("Parameters:");
|
|
821
819
|
console.log("--assessmentId [number] The id of the assessment to retrieve.");
|
|
822
820
|
console.log();
|
|
823
821
|
console.log(
|
|
824
822
|
"check-mssql-config-metadata",
|
|
825
|
-
"Checks the mssql configuration metadata for a company."
|
|
823
|
+
"Checks the mssql configuration metadata for a company.",
|
|
826
824
|
);
|
|
827
825
|
console.log("Parameters:");
|
|
828
826
|
console.log("--accountId [string] The account id for the company.");
|
|
829
827
|
console.log(`--company [company_slug] (default: ${global.company})\n`);
|
|
830
828
|
console.log(
|
|
831
|
-
"--lastCollectedBefore [string] (optional) Only returns records that have not been collected since the given date. Format: UTC, example: '2022-08-23T17:00:00Z'"
|
|
829
|
+
"--lastCollectedBefore [string] (optional) Only returns records that have not been collected since the given date. Format: UTC, example: '2022-08-23T17:00:00Z'",
|
|
832
830
|
);
|
|
833
831
|
console.log();
|
|
834
832
|
}
|
|
835
833
|
|
|
834
|
+
export {
|
|
835
|
+
deleteMssqlEntitlements,
|
|
836
|
+
createMssqlEntitlement,
|
|
837
|
+
updateMssqlEntitlement,
|
|
838
|
+
getMssqlEntitlements,
|
|
839
|
+
getMssqlEntitlementComponents,
|
|
840
|
+
listMssqlAssessments,
|
|
841
|
+
getMssqlAssessment,
|
|
842
|
+
getMssqlAssessmentEntitlements,
|
|
843
|
+
getMssqlAssessmentLicenseUsageMaps,
|
|
844
|
+
getMssqlAssessmentResources,
|
|
845
|
+
checkMssqlConfigMetadata,
|
|
846
|
+
listMssqlConfigurations,
|
|
847
|
+
getMssqlDefaultCredential,
|
|
848
|
+
createMssqlSharedCredential,
|
|
849
|
+
deleteMssqlSharedCredential,
|
|
850
|
+
updateMssqlSharedCredential,
|
|
851
|
+
getMssqlConfiguration,
|
|
852
|
+
createMssqlConfiguration,
|
|
853
|
+
updateMssqlConfiguration,
|
|
854
|
+
updateMssqlConfigurations,
|
|
855
|
+
deleteMssqlConfiguration,
|
|
856
|
+
printMssqlHelp,
|
|
857
|
+
};
|
|
858
|
+
|
|
836
859
|
const licenseManagerMssqlModule = {
|
|
837
860
|
description: "License Manager Microsoft module for OpsCompass CLI",
|
|
838
861
|
requiresLogin: true,
|
|
@@ -859,4 +882,4 @@ const licenseManagerMssqlModule = {
|
|
|
859
882
|
deleteMssqlConfiguration,
|
|
860
883
|
printMssqlHelp,
|
|
861
884
|
};
|
|
862
|
-
|
|
885
|
+
export default licenseManagerMssqlModule;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { getOpsCompassClient } from "../../opscompass.js";
|
|
2
|
+
import { utilsModule as utils } from "../../lib/utils.js";
|
|
3
|
+
import maskValues from "../../lib/maskValues.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @module license-manager:nutanix
|
|
7
7
|
* @description License Manager Nutanix module for OpsCompass CLI
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { createMaskedConfig, updateMaskedConfig } from "./maskedConfig.js";
|
|
11
11
|
|
|
12
12
|
async function deleteNutanixConfiguration(args) {
|
|
13
13
|
let id = undefined;
|
|
@@ -29,7 +29,7 @@ async function listNutanixConfigurations(args) {
|
|
|
29
29
|
const client = await getOpsCompassClient();
|
|
30
30
|
const listNutanixConfigs =
|
|
31
31
|
await client.licenseManager.nutanix.listConfigurations(
|
|
32
|
-
global.monitoringConfig
|
|
32
|
+
global.monitoringConfig,
|
|
33
33
|
);
|
|
34
34
|
|
|
35
35
|
// For listing show the raw data (do not unmask the data here)
|
|
@@ -50,9 +50,8 @@ async function getNutanixConfiguration(args) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const client = await getOpsCompassClient();
|
|
53
|
-
const getNutanixConfig =
|
|
54
|
-
id
|
|
55
|
-
);
|
|
53
|
+
const getNutanixConfig =
|
|
54
|
+
await client.licenseManager.nutanix.getConfiguration(id);
|
|
56
55
|
|
|
57
56
|
console.log(JSON.stringify(getNutanixConfig, null, 2));
|
|
58
57
|
}
|
|
@@ -91,7 +90,7 @@ async function createNutanixConfiguration(args) {
|
|
|
91
90
|
const nutanixConfiguration = await createMaskedConfig(
|
|
92
91
|
arguments.callee.name,
|
|
93
92
|
configurationName,
|
|
94
|
-
optionalParams
|
|
93
|
+
optionalParams,
|
|
95
94
|
);
|
|
96
95
|
console.log(JSON.stringify(nutanixConfiguration, null, 2));
|
|
97
96
|
}
|
|
@@ -126,7 +125,7 @@ async function updateNutanixConfiguration(args) {
|
|
|
126
125
|
const nutanixConfiguration = await updateMaskedConfig(
|
|
127
126
|
arguments.callee.name,
|
|
128
127
|
callParams.id,
|
|
129
|
-
callParams
|
|
128
|
+
callParams,
|
|
130
129
|
);
|
|
131
130
|
console.log(JSON.stringify(nutanixConfiguration, null, 2));
|
|
132
131
|
}
|
|
@@ -200,27 +199,27 @@ async function updateNutanixConfigurations(args) {
|
|
|
200
199
|
async function printNutanixHelp() {
|
|
201
200
|
console.log(
|
|
202
201
|
"list-nutanix-configurations",
|
|
203
|
-
"Lists all of the nutanix configurations associated with the given monitoring configuration"
|
|
202
|
+
"Lists all of the nutanix configurations associated with the given monitoring configuration",
|
|
204
203
|
);
|
|
205
204
|
console.log("Parameters:");
|
|
206
205
|
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
207
206
|
console.log();
|
|
208
207
|
console.log(
|
|
209
208
|
"get-nutanix-configuration",
|
|
210
|
-
"Get a single nutanix configuration associated with the given monitoring configuration"
|
|
209
|
+
"Get a single nutanix configuration associated with the given monitoring configuration",
|
|
211
210
|
);
|
|
212
211
|
console.log("Parameters:");
|
|
213
212
|
console.log("--id [nutanix_configuration_id]");
|
|
214
213
|
console.log();
|
|
215
214
|
console.log(
|
|
216
215
|
"create-nutanix-configuration",
|
|
217
|
-
"Create a single nutanix configuration associated with the given monitoring configuration."
|
|
216
|
+
"Create a single nutanix configuration associated with the given monitoring configuration.",
|
|
218
217
|
);
|
|
219
218
|
console.log("Parameters:");
|
|
220
219
|
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
221
220
|
console.log("--name [unique name]");
|
|
222
221
|
console.log(
|
|
223
|
-
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "inventory"
|
|
222
|
+
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "inventory"`,
|
|
224
223
|
);
|
|
225
224
|
console.log("--server (optional) [the hostname or ip address]");
|
|
226
225
|
console.log("--user (optional) [server username]");
|
|
@@ -228,13 +227,13 @@ async function printNutanixHelp() {
|
|
|
228
227
|
console.log();
|
|
229
228
|
console.log(
|
|
230
229
|
"update-nutanix-configuration",
|
|
231
|
-
"Update a single nutanix configuration."
|
|
230
|
+
"Update a single nutanix configuration.",
|
|
232
231
|
);
|
|
233
232
|
console.log("Parameters:");
|
|
234
233
|
console.log("--id [configuration id]");
|
|
235
234
|
console.log("--name or --configuration-name (optional) [unique name]");
|
|
236
235
|
console.log(
|
|
237
|
-
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'inventory']"
|
|
236
|
+
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'inventory']",
|
|
238
237
|
);
|
|
239
238
|
console.log("--server (optional) [the hostname or ip address]");
|
|
240
239
|
console.log("--user (optional) [server username]");
|
|
@@ -242,13 +241,13 @@ async function printNutanixHelp() {
|
|
|
242
241
|
console.log();
|
|
243
242
|
console.log(
|
|
244
243
|
"update-nutanix-configurations",
|
|
245
|
-
"Bulk Update nutanix configurations."
|
|
244
|
+
"Bulk Update nutanix configurations.",
|
|
246
245
|
);
|
|
247
246
|
console.log("Parameters:");
|
|
248
247
|
console.log("--id [configuration id]");
|
|
249
248
|
console.log("--name or --configuration-name (optional) [unique name]");
|
|
250
249
|
console.log(
|
|
251
|
-
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "inventory"
|
|
250
|
+
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "inventory"`,
|
|
252
251
|
);
|
|
253
252
|
console.log("--server (optional) [the hostname or ip address]");
|
|
254
253
|
console.log("--user (optional) [server username]");
|
|
@@ -256,13 +255,13 @@ async function printNutanixHelp() {
|
|
|
256
255
|
console.log("OR --json-updates [stringified json objects with your updates]");
|
|
257
256
|
console.log("For quick updates, you may use the above parameters");
|
|
258
257
|
console.log(
|
|
259
|
-
`e.g. opscompass license-manager update-nutanix-configurations --id 137 --name "updatedName" --id 138 --name "otherUpdatedName" --id 144 --name "lastUpdatedName" --action "skip" --action "inventory"
|
|
258
|
+
`e.g. opscompass license-manager update-nutanix-configurations --id 137 --name "updatedName" --id 138 --name "otherUpdatedName" --id 144 --name "lastUpdatedName" --action "skip" --action "inventory";`,
|
|
260
259
|
);
|
|
261
260
|
console.log(
|
|
262
|
-
"For larger updates, JavaScript Object Notation (JSON) may be used with the --json-updates flag"
|
|
261
|
+
"For larger updates, JavaScript Object Notation (JSON) may be used with the --json-updates flag",
|
|
263
262
|
);
|
|
264
263
|
console.log(
|
|
265
|
-
`e.g. opscompass license-manager update-nutanix-configurations --json-updates '[{\"id\":\"137\",\"configurationName\":\"updatedName\"},{\"id\":\"138\",\"configurationName\":\"otherUpdatedName\"},{\"id\":\"144\",\"configurationName\":\"lastUpdatedName\", \"actions\":[\"skip\", \"inventory\"]}]'
|
|
264
|
+
`e.g. opscompass license-manager update-nutanix-configurations --json-updates '[{\"id\":\"137\",\"configurationName\":\"updatedName\"},{\"id\":\"138\",\"configurationName\":\"otherUpdatedName\"},{\"id\":\"144\",\"configurationName\":\"lastUpdatedName\", \"actions\":[\"skip\", \"inventory\"]}]'`,
|
|
266
265
|
);
|
|
267
266
|
console.log();
|
|
268
267
|
console.log("delete-nutanix-configuration", "Delete a nutanix configuration");
|
|
@@ -271,6 +270,16 @@ async function printNutanixHelp() {
|
|
|
271
270
|
console.log();
|
|
272
271
|
}
|
|
273
272
|
|
|
273
|
+
export {
|
|
274
|
+
listNutanixConfigurations,
|
|
275
|
+
getNutanixConfiguration,
|
|
276
|
+
createNutanixConfiguration,
|
|
277
|
+
updateNutanixConfiguration,
|
|
278
|
+
updateNutanixConfigurations,
|
|
279
|
+
deleteNutanixConfiguration,
|
|
280
|
+
printNutanixHelp,
|
|
281
|
+
};
|
|
282
|
+
|
|
274
283
|
const licenseManagerNutanixModule = {
|
|
275
284
|
description: "License Manager Nutanix module for OpsCompass CLI",
|
|
276
285
|
requiresLogin: true,
|
|
@@ -282,4 +291,4 @@ const licenseManagerNutanixModule = {
|
|
|
282
291
|
deleteNutanixConfiguration,
|
|
283
292
|
printNutanixHelp,
|
|
284
293
|
};
|
|
285
|
-
|
|
294
|
+
export default licenseManagerNutanixModule;
|