@opscompass/opscompass-cli 1.0.46 → 1.3.1
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 -4
- 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 +42 -23
- 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 +15 -19
- 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 +58 -48
|
@@ -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:vcenter
|
|
7
7
|
* @description License Manager Vcenter module for OpsCompass CLI
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { createMaskedConfig, updateMaskedConfig } from "./maskedConfig.js";
|
|
11
11
|
|
|
12
12
|
async function deleteVcenterConfiguration(args) {
|
|
13
13
|
let id = undefined;
|
|
@@ -29,7 +29,7 @@ async function listVcenterConfigurations(args) {
|
|
|
29
29
|
const client = await getOpsCompassClient();
|
|
30
30
|
const listVcenterConfigs =
|
|
31
31
|
await client.licenseManager.vcenter.listConfigurations(
|
|
32
|
-
global.monitoringConfig
|
|
32
|
+
global.monitoringConfig,
|
|
33
33
|
);
|
|
34
34
|
|
|
35
35
|
console.log(JSON.stringify(listVcenterConfigs, null, 2));
|
|
@@ -46,9 +46,8 @@ async function getVcenterConfiguration(args) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const client = await getOpsCompassClient();
|
|
49
|
-
const getVcenterConfig =
|
|
50
|
-
id
|
|
51
|
-
);
|
|
49
|
+
const getVcenterConfig =
|
|
50
|
+
await client.licenseManager.vcenter.getConfiguration(id);
|
|
52
51
|
|
|
53
52
|
console.log(JSON.stringify(getVcenterConfig, null, 2));
|
|
54
53
|
}
|
|
@@ -87,7 +86,7 @@ async function createVcenterConfiguration(args) {
|
|
|
87
86
|
const vCenterConfiguration = await createMaskedConfig(
|
|
88
87
|
arguments.callee.name,
|
|
89
88
|
configurationName,
|
|
90
|
-
optionalParams
|
|
89
|
+
optionalParams,
|
|
91
90
|
);
|
|
92
91
|
console.log(JSON.stringify(vCenterConfiguration, null, 2));
|
|
93
92
|
}
|
|
@@ -122,7 +121,7 @@ async function updateVcenterConfiguration(args) {
|
|
|
122
121
|
const vCenterConfiguration = await updateMaskedConfig(
|
|
123
122
|
arguments.callee.name,
|
|
124
123
|
callParams.id,
|
|
125
|
-
callParams
|
|
124
|
+
callParams,
|
|
126
125
|
);
|
|
127
126
|
console.log(JSON.stringify(vCenterConfiguration, null, 2));
|
|
128
127
|
}
|
|
@@ -196,27 +195,27 @@ async function updateVcenterConfigurations(args) {
|
|
|
196
195
|
async function printVcenterHelp() {
|
|
197
196
|
console.log(
|
|
198
197
|
"list-vcenter-configurations",
|
|
199
|
-
"Lists all of the vcenter configurations associated with the given monitoring configuration"
|
|
198
|
+
"Lists all of the vcenter configurations associated with the given monitoring configuration",
|
|
200
199
|
);
|
|
201
200
|
console.log("Parameters:");
|
|
202
201
|
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
203
202
|
console.log();
|
|
204
203
|
console.log(
|
|
205
204
|
"get-vcenter-configuration",
|
|
206
|
-
"Get a single vcenter configuration associated with the given monitoring configuration"
|
|
205
|
+
"Get a single vcenter configuration associated with the given monitoring configuration",
|
|
207
206
|
);
|
|
208
207
|
console.log("Parameters:");
|
|
209
208
|
console.log("--id [vcenter_configuration_id]");
|
|
210
209
|
console.log();
|
|
211
210
|
console.log(
|
|
212
211
|
"create-vcenter-configuration",
|
|
213
|
-
"Create a single vcenter configuration associated with the given monitoring configuration."
|
|
212
|
+
"Create a single vcenter configuration associated with the given monitoring configuration.",
|
|
214
213
|
);
|
|
215
214
|
console.log("Parameters:");
|
|
216
215
|
console.log("--monitoring-configuration-id [monitoring_configuration_id]");
|
|
217
216
|
console.log("--name [unique name]");
|
|
218
217
|
console.log(
|
|
219
|
-
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "vmotion"
|
|
218
|
+
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "vmotion"`,
|
|
220
219
|
);
|
|
221
220
|
console.log("--connection (optional) [the hostname or ip address]");
|
|
222
221
|
console.log("--user (optional) [connection username]");
|
|
@@ -224,13 +223,13 @@ async function printVcenterHelp() {
|
|
|
224
223
|
console.log();
|
|
225
224
|
console.log(
|
|
226
225
|
"update-vcenter-configuration",
|
|
227
|
-
"Update a single vcenter configuration."
|
|
226
|
+
"Update a single vcenter configuration.",
|
|
228
227
|
);
|
|
229
228
|
console.log("Parameters:");
|
|
230
229
|
console.log("--id [configuration id]");
|
|
231
230
|
console.log("--name or --configuration-name (optional) [unique name]");
|
|
232
231
|
console.log(
|
|
233
|
-
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'vmotion']"
|
|
232
|
+
"--action (optional) pass multiple times to define which actions this configuration can take e.g. --action 'skip' --action 'vmotion']",
|
|
234
233
|
);
|
|
235
234
|
console.log("--connection (optional) [the hostname or ip address]");
|
|
236
235
|
console.log("--user (optional) [connection username]");
|
|
@@ -238,13 +237,13 @@ async function printVcenterHelp() {
|
|
|
238
237
|
console.log();
|
|
239
238
|
console.log(
|
|
240
239
|
"update-vcenter-configurations",
|
|
241
|
-
"Bulk Update vcenter configurations."
|
|
240
|
+
"Bulk Update vcenter configurations.",
|
|
242
241
|
);
|
|
243
242
|
console.log("Parameters:");
|
|
244
243
|
console.log("--id [configuration id]");
|
|
245
244
|
console.log("--name or --configuration-name (optional) [unique name]");
|
|
246
245
|
console.log(
|
|
247
|
-
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "vmotion"
|
|
246
|
+
`--action (optional) pass multiple times to define which actions this configuration can take e.g. --action "skip" --action "vmotion"`,
|
|
248
247
|
);
|
|
249
248
|
console.log("--connection (optional) [the hostname or ip address]");
|
|
250
249
|
console.log("--user (optional) [connection username]");
|
|
@@ -252,13 +251,13 @@ async function printVcenterHelp() {
|
|
|
252
251
|
console.log("OR --json-updates [stringified json objects with your updates]");
|
|
253
252
|
console.log("For quick updates, you may use the above parameters");
|
|
254
253
|
console.log(
|
|
255
|
-
`e.g. opscompass license-manager update-vcenter-configurations --id 137 --name "updatedName" --id 138 --name "otherUpdatedName" --id 144 --name "lastUpdatedName" --action "skip" --action "vmotion"
|
|
254
|
+
`e.g. opscompass license-manager update-vcenter-configurations --id 137 --name "updatedName" --id 138 --name "otherUpdatedName" --id 144 --name "lastUpdatedName" --action "skip" --action "vmotion";`,
|
|
256
255
|
);
|
|
257
256
|
console.log(
|
|
258
|
-
"For larger updates, JavaScript Object Notation (JSON) may be used with the --json-updates flag"
|
|
257
|
+
"For larger updates, JavaScript Object Notation (JSON) may be used with the --json-updates flag",
|
|
259
258
|
);
|
|
260
259
|
console.log(
|
|
261
|
-
`e.g. opscompass license-manager update-vcenter-configurations --json-updates '[{\"id\":\"137\",\"configurationName\":\"updatedName\"},{\"id\":\"138\",\"configurationName\":\"otherUpdatedName\"},{\"id\":\"144\",\"configurationName\":\"lastUpdatedName\", \"actions\":[\"skip\", \"vmotion\"]}]'
|
|
260
|
+
`e.g. opscompass license-manager update-vcenter-configurations --json-updates '[{\"id\":\"137\",\"configurationName\":\"updatedName\"},{\"id\":\"138\",\"configurationName\":\"otherUpdatedName\"},{\"id\":\"144\",\"configurationName\":\"lastUpdatedName\", \"actions\":[\"skip\", \"vmotion\"]}]'`,
|
|
262
261
|
);
|
|
263
262
|
console.log();
|
|
264
263
|
console.log("delete-vcenter-configuration", "Delete a vcenter configuration");
|
|
@@ -267,6 +266,16 @@ async function printVcenterHelp() {
|
|
|
267
266
|
console.log();
|
|
268
267
|
}
|
|
269
268
|
|
|
269
|
+
export {
|
|
270
|
+
listVcenterConfigurations,
|
|
271
|
+
getVcenterConfiguration,
|
|
272
|
+
createVcenterConfiguration,
|
|
273
|
+
updateVcenterConfiguration,
|
|
274
|
+
updateVcenterConfigurations,
|
|
275
|
+
deleteVcenterConfiguration,
|
|
276
|
+
printVcenterHelp,
|
|
277
|
+
};
|
|
278
|
+
|
|
270
279
|
const licenseManagerVcenterModule = {
|
|
271
280
|
description: "License Manager Vcenter module for OpsCompass CLI",
|
|
272
281
|
requiresLogin: true,
|
|
@@ -278,4 +287,4 @@ const licenseManagerVcenterModule = {
|
|
|
278
287
|
deleteVcenterConfiguration,
|
|
279
288
|
printVcenterHelp,
|
|
280
289
|
};
|
|
281
|
-
|
|
290
|
+
export default licenseManagerVcenterModule;
|