@opscompass/opscompass-cli 1.0.47 → 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.
@@ -1,13 +1,13 @@
1
- const { getOpsCompassClient } = require("../../opscompass.js");
2
- const { utilsModule: utils } = require("../../lib/utils.js");
3
- const maskValues = require("../../lib/maskValues.js");
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
- const { createMaskedConfig, updateMaskedConfig } = require("./maskedConfig.js");
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 = await client.licenseManager.vcenter.getConfiguration(
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
- module.exports = licenseManagerVcenterModule;
290
+ export default licenseManagerVcenterModule;