@dishantlangayan/solace-cloud-cli 0.0.3 → 0.0.4

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/README.md CHANGED
@@ -22,7 +22,7 @@ $ npm install -g @dishantlangayan/solace-cloud-cli
22
22
  $ sc COMMAND
23
23
  running command...
24
24
  $ sc (--version)
25
- @dishantlangayan/solace-cloud-cli/0.0.3 darwin-x64 node-v23.10.0
25
+ @dishantlangayan/solace-cloud-cli/0.0.4 darwin-arm64 node-v24.1.0
26
26
  $ sc --help [COMMAND]
27
27
  USAGE
28
28
  $ sc COMMAND
@@ -51,6 +51,7 @@ The following Environment variables are optional:
51
51
  * [`sc missionctrl broker display`](#sc-missionctrl-broker-display)
52
52
  * [`sc missionctrl broker list`](#sc-missionctrl-broker-list)
53
53
  * [`sc missionctrl broker opstatus`](#sc-missionctrl-broker-opstatus)
54
+ * [`sc missionctrl broker update`](#sc-missionctrl-broker-update)
54
55
  * [`sc platform env create`](#sc-platform-env-create)
55
56
  * [`sc platform env delete`](#sc-platform-env-delete)
56
57
  * [`sc platform env display`](#sc-platform-env-display)
@@ -144,7 +145,7 @@ EXAMPLES
144
145
  $ sc missionctrl broker create --name=MyBrokerName --datacenter-id=eks-ca-central-1a --service-class-id=DEVELOPER
145
146
  ```
146
147
 
147
- _See code: [src/commands/missionctrl/broker/create.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/missionctrl/broker/create.ts)_
148
+ _See code: [src/commands/missionctrl/broker/create.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/missionctrl/broker/create.ts)_
148
149
 
149
150
  ## `sc missionctrl broker delete`
150
151
 
@@ -176,7 +177,7 @@ EXAMPLES
176
177
  $ sc missionctrl broker delete --name=MyBrokerName
177
178
  ```
178
179
 
179
- _See code: [src/commands/missionctrl/broker/delete.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/missionctrl/broker/delete.ts)_
180
+ _See code: [src/commands/missionctrl/broker/delete.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/missionctrl/broker/delete.ts)_
180
181
 
181
182
  ## `sc missionctrl broker display`
182
183
 
@@ -207,7 +208,7 @@ EXAMPLES
207
208
  $ sc missionctrl broker display
208
209
  ```
209
210
 
210
- _See code: [src/commands/missionctrl/broker/display.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/missionctrl/broker/display.ts)_
211
+ _See code: [src/commands/missionctrl/broker/display.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/missionctrl/broker/display.ts)_
211
212
 
212
213
  ## `sc missionctrl broker list`
213
214
 
@@ -253,23 +254,24 @@ EXAMPLES
253
254
  $ sc missionctrl broker list --name=MyBrokerName --pageNumber=1 --pageSize=10 --sort=name:asc
254
255
  ```
255
256
 
256
- _See code: [src/commands/missionctrl/broker/list.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/missionctrl/broker/list.ts)_
257
+ _See code: [src/commands/missionctrl/broker/list.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/missionctrl/broker/list.ts)_
257
258
 
258
259
  ## `sc missionctrl broker opstatus`
259
260
 
260
- Get the status of an operation that being performed on an event broker service.
261
+ Get the status of all operations being performed on an event broker service.
261
262
 
262
263
  ```
263
264
  USAGE
264
- $ sc missionctrl broker opstatus [--json] [--log-level debug|warn|error|info|trace] [-b <value>] [-n <value>] [-o
265
- <value>] [-p]
265
+ $ sc missionctrl broker opstatus [--json] [--log-level debug|warn|error|info|trace] [-b <value>] [-n <value>] [-p] [-w
266
+ <value>]
266
267
 
267
268
  FLAGS
268
- -b, --broker-id=<value> Id of the event broker service.
269
- -n, --name=<value> Name of the event broker service.
270
- -o, --operation-id=<value> The identifier of the operation being performed on the event broker service.
271
- -p, --show-progress Displays a status bar of the in-progress operation. The command will wait for completion
272
- of each step of the operation.
269
+ -b, --broker-id=<value> Id of the event broker service.
270
+ -n, --name=<value> Name of the event broker service.
271
+ -p, --show-progress Displays a status bar of the in-progress operations. The command will wait for completion of
272
+ each step of the operation.
273
+ -w, --wait-ms=<value> The milliseconds to wait between API calls for checking progress of the operation. Default is
274
+ 5000 ms.
273
275
 
274
276
  GLOBAL FLAGS
275
277
  --json Format output as json.
@@ -277,17 +279,55 @@ GLOBAL FLAGS
277
279
  <options: debug|warn|error|info|trace>
278
280
 
279
281
  DESCRIPTION
280
- Get the status of an operation that being performed on an event broker service.
281
- To get the operation, you provide identifier of the operation and the identifier of the event broker service.
282
+ Get the status of all operations being performed on an event broker service.
283
+ To get the operation status, you must provide the identifier or name of the event broker service.
282
284
 
283
285
  Token Permissions: [ mission_control:access or services:get or services:get:self or services:view or
284
286
  services:view:self ]
285
287
 
286
288
  EXAMPLES
287
- $ sc missionctrl broker opstatus
289
+ $ sc missionctrl broker opstatus -b <broker-id>
290
+
291
+ $ sc missionctrl broker opstatus -n <broker-name>
292
+ ```
293
+
294
+ _See code: [src/commands/missionctrl/broker/opstatus.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/missionctrl/broker/opstatus.ts)_
295
+
296
+ ## `sc missionctrl broker update`
297
+
298
+ Update the configuration of an existing event broker service.
299
+
300
+ ```
301
+ USAGE
302
+ $ sc missionctrl broker update [--json] [--log-level debug|warn|error|info|trace] [-b <value>] [-l <value>] [-n <value>]
303
+ [--new-name <value>]
304
+
305
+ FLAGS
306
+ -b, --broker-id=<value> Id of the event broker service.
307
+ -l, --locked=<value> Indicates whether the event broker service has deletion protection enabled. The valid values
308
+ are 'true' (enabled) or 'false' (disabled).
309
+ -n, --name=<value> Name of the event broker service.
310
+ --new-name=<value> New name of the event broker service. The new service name must be unique within an
311
+ organization.
312
+
313
+ GLOBAL FLAGS
314
+ --json Format output as json.
315
+ --log-level=<option> [default: info] Specify level for logging.
316
+ <options: debug|warn|error|info|trace>
317
+
318
+ DESCRIPTION
319
+ Update the configuration of an existing event broker service.
320
+ You can provide any combination of supported flags. If a flag is not provided, then it will not be updated.
321
+
322
+ Your token must have one of the permissions listed in the Token Permissions.
323
+
324
+ Token Permissions: [ mission_control:access or services:put ]
325
+
326
+ EXAMPLES
327
+ $ sc missionctrl broker update
288
328
  ```
289
329
 
290
- _See code: [src/commands/missionctrl/broker/opstatus.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/missionctrl/broker/opstatus.ts)_
330
+ _See code: [src/commands/missionctrl/broker/update.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/missionctrl/broker/update.ts)_
291
331
 
292
332
  ## `sc platform env create`
293
333
 
@@ -299,13 +339,13 @@ USAGE
299
339
  [--isProduction]
300
340
 
301
341
  FLAGS
302
- -d, --desc=<value> Description of the environment to create.
303
- -n, --name=<value> (required) Name of the environment to create.
304
- --isDefault Indicates this is the organization’s default environment.
305
- --isProduction Indicates this is an organization’s production environment.
306
- This is an immutable field. If an environment needs to be migrated,
307
- architecture can be migrated to a new environment with the desired
308
- environment type instead.
342
+ -d, --description=<value> Description of the environment to create.
343
+ -n, --name=<value> (required) Name of the environment to create.
344
+ --isDefault Indicates this is the organization’s default environment.
345
+ --isProduction Indicates this is an organization’s production environment.
346
+ This is an immutable field. If an environment needs to be migrated,
347
+ architecture can be migrated to a new environment with the desired
348
+ environment type instead.
309
349
 
310
350
  GLOBAL FLAGS
311
351
  --json Format output as json.
@@ -321,7 +361,7 @@ EXAMPLES
321
361
  $ sc platform env create --name=MyEnvironment --desc="My environment description" --isDefault --isProduction
322
362
  ```
323
363
 
324
- _See code: [src/commands/platform/env/create.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/platform/env/create.ts)_
364
+ _See code: [src/commands/platform/env/create.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/platform/env/create.ts)_
325
365
 
326
366
  ## `sc platform env delete`
327
367
 
@@ -351,7 +391,7 @@ EXAMPLES
351
391
  $ sc platform env delete --env-id=MyEnvId
352
392
  ```
353
393
 
354
- _See code: [src/commands/platform/env/delete.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/platform/env/delete.ts)_
394
+ _See code: [src/commands/platform/env/delete.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/platform/env/delete.ts)_
355
395
 
356
396
  ## `sc platform env display`
357
397
 
@@ -383,7 +423,7 @@ EXAMPLES
383
423
  $ sc platform env display --env-id=MyEnvId
384
424
  ```
385
425
 
386
- _See code: [src/commands/platform/env/display.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/platform/env/display.ts)_
426
+ _See code: [src/commands/platform/env/display.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/platform/env/display.ts)_
387
427
 
388
428
  ## `sc platform env list`
389
429
 
@@ -416,7 +456,7 @@ EXAMPLES
416
456
  $ sc platform env list --name=Default --pageNumber=1 --pageSize=10 --sort=name:ASC
417
457
  ```
418
458
 
419
- _See code: [src/commands/platform/env/list.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/platform/env/list.ts)_
459
+ _See code: [src/commands/platform/env/list.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/platform/env/list.ts)_
420
460
 
421
461
  ## `sc platform env update`
422
462
 
@@ -428,11 +468,11 @@ USAGE
428
468
  <value>] [--new-name <value>]
429
469
 
430
470
  FLAGS
431
- -d, --desc=<value> Description of the environment to update.
432
- -e, --env-id=<value> Id of the environment.
433
- -n, --name=<value> Current name of the environment.
434
- --isDefault Indicates this is the organization's default environment. The default value is false.
435
- --new-name=<value> New name of the environment.
471
+ -d, --description=<value> Description of the environment to update.
472
+ -e, --env-id=<value> Id of the environment.
473
+ -n, --name=<value> Current name of the environment.
474
+ --isDefault Indicates this is the organization's default environment. The default value is false.
475
+ --new-name=<value> New name of the environment.
436
476
 
437
477
  GLOBAL FLAGS
438
478
  --json Format output as json.
@@ -453,7 +493,7 @@ EXAMPLES
453
493
  $ sc platform env update --env-id=MyEnvId --new-name=MyNewEnvName --desc="My description to update" --isDefault
454
494
  ```
455
495
 
456
- _See code: [src/commands/platform/env/update.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.3/src/commands/platform/env/update.ts)_
496
+ _See code: [src/commands/platform/env/update.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.0.4/src/commands/platform/env/update.ts)_
457
497
 
458
498
  ## `sc plugins`
459
499
 
@@ -1,5 +1,5 @@
1
1
  import { ScCommand } from '../../../sc-command.js';
2
- import { EventBrokerCreateDetail } from '../../../types/broker.js';
2
+ import { EventBrokerOperationDetail } from '../../../types/broker.js';
3
3
  export default class MissionctrlBrokerCreate extends ScCommand<typeof MissionctrlBrokerCreate> {
4
4
  static args: {};
5
5
  static description: string;
@@ -15,6 +15,6 @@ export default class MissionctrlBrokerCreate extends ScCommand<typeof Missionctr
15
15
  'service-class-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
16
  version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
17
  };
18
- run(): Promise<EventBrokerCreateDetail>;
18
+ run(): Promise<EventBrokerOperationDetail>;
19
19
  private print;
20
20
  }
@@ -9,7 +9,9 @@ export default class MissionctrlBrokerCreate extends ScCommand {
9
9
  Your token must have one of the permissions listed in the Token Permissions.
10
10
 
11
11
  Token Permissions: [ \`services:post\` ]`;
12
- static examples = ['<%= config.bin %> <%= command.id %> --name=MyBrokerName --datacenter-id=eks-ca-central-1a --service-class-id=DEVELOPER'];
12
+ static examples = [
13
+ '<%= config.bin %> <%= command.id %> --name=MyBrokerName --datacenter-id=eks-ca-central-1a --service-class-id=DEVELOPER',
14
+ ];
13
15
  static flags = {
14
16
  'datacenter-id': Flags.string({
15
17
  char: 'd',
@@ -39,7 +41,7 @@ Token Permissions: [ \`services:post\` ]`;
39
41
  name: Flags.string({
40
42
  char: 'n',
41
43
  description: 'Name of the event broker service to create.',
42
- required: true
44
+ required: true,
43
45
  }),
44
46
  'redundancy-group-ssl-enabled': Flags.boolean({
45
47
  char: 'r',
@@ -85,7 +87,7 @@ Token Permissions: [ \`services:post\` ]`;
85
87
  // API body
86
88
  const body = {
87
89
  ...(datacenterId && { datacenterId }),
88
- ...(envId) && { environmentId: envId },
90
+ ...(envId && { environmentId: envId }),
89
91
  ...(eventBrokerVersion && { eventBrokerVersion }),
90
92
  locked,
91
93
  ...(maxSpoolUsage && { maxSpoolUsage }),
@@ -1,4 +1,5 @@
1
1
  import { ScCommand } from '../../../sc-command.js';
2
+ import { EventBrokerOperationDetail } from '../../../types/broker.js';
2
3
  export default class MissionctrlBrokerDelete extends ScCommand<typeof MissionctrlBrokerDelete> {
3
4
  static args: {};
4
5
  static description: string;
@@ -7,7 +8,6 @@ export default class MissionctrlBrokerDelete extends ScCommand<typeof Missionctr
7
8
  'broker-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  };
10
- run(): Promise<{
11
- message: string;
12
- }>;
11
+ run(): Promise<EventBrokerOperationDetail>;
12
+ private print;
13
13
  }
@@ -1,5 +1,6 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import { ScCommand } from '../../../sc-command.js';
3
+ import { camelCaseToTitleCase, renderKeyValueTable } from '../../../util/internal.js';
3
4
  import { ScConnection } from '../../../util/sc-connection.js';
4
5
  export default class MissionctrlBrokerDelete extends ScCommand {
5
6
  static args = {};
@@ -47,9 +48,17 @@ Token Permissions: [ \`services:delete\` **or** \`services:delete:self\` **or**
47
48
  }
48
49
  // API call to delete environment by id
49
50
  apiUrl += `/${brokerIdToDelete}`;
50
- await conn.delete(apiUrl);
51
- const message = `Event broker service with id '${brokerIdToDelete}' has been deleted successfully.`;
52
- this.log(message);
53
- return { message };
51
+ const resp = await conn.delete(apiUrl);
52
+ // Display results
53
+ this.print(resp.data);
54
+ return resp.data;
55
+ }
56
+ print(broker) {
57
+ const tableRows = [
58
+ ['Key', 'Value'],
59
+ ...Object.entries(broker).map(([key, value]) => [camelCaseToTitleCase(key), value]),
60
+ ];
61
+ this.log();
62
+ this.log(renderKeyValueTable(tableRows));
54
63
  }
55
64
  }
@@ -36,8 +36,8 @@ export default class MissionctrlBrokerDisplay extends ScCommand {
36
36
  // API call to get broker by id
37
37
  apiUrl += `/${brokerId}`;
38
38
  const resp = await conn.get(apiUrl);
39
- this.print(resp);
40
- rawResp = [resp];
39
+ this.print(resp.data);
40
+ rawResp = [resp.data];
41
41
  }
42
42
  else if (name) {
43
43
  // API call to get broker by name
@@ -1,5 +1,5 @@
1
1
  import { ScCommand } from '../../../sc-command.js';
2
- import { OperationData } from '../../../types/broker.js';
2
+ import { EventBrokerOperationDetail } from '../../../types/broker.js';
3
3
  export default class MissionctrlBrokerOpstatus extends ScCommand<typeof MissionctrlBrokerOpstatus> {
4
4
  static args: {};
5
5
  static description: string;
@@ -7,9 +7,9 @@ export default class MissionctrlBrokerOpstatus extends ScCommand<typeof Missionc
7
7
  static flags: {
8
8
  'broker-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- 'operation-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
10
  'show-progress': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ 'wait-ms': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  };
13
- run(): Promise<OperationData>;
14
- private print;
13
+ run(): Promise<EventBrokerOperationDetail[]>;
14
+ private pollAllOperationStatus;
15
15
  }
@@ -1,16 +1,17 @@
1
1
  import { Flags } from '@oclif/core';
2
- import cliProgress from 'cli-progress';
2
+ import { MultiBar, Presets } from 'cli-progress';
3
3
  import { ScCommand } from '../../../sc-command.js';
4
+ import { renderTable, sleep } from '../../../util/internal.js';
4
5
  import { ScConnection } from '../../../util/sc-connection.js';
5
- import { camelCaseToTitleCase, renderKeyValueTable, sleep } from '../../../util/internal.js';
6
6
  export default class MissionctrlBrokerOpstatus extends ScCommand {
7
7
  static args = {};
8
- static description = `Get the status of an operation that being performed on an event broker service.
9
- To get the operation, you provide identifier of the operation and the identifier of the event broker service.
8
+ static description = `Get the status of all operations being performed on an event broker service.
9
+ To get the operation status, you must provide the identifier or name of the event broker service.
10
10
 
11
11
  Token Permissions: [ mission_control:access or services:get or services:get:self or services:view or services:view:self ]`;
12
12
  static examples = [
13
- '<%= config.bin %> <%= command.id %>',
13
+ '<%= config.bin %> <%= command.id %> -b <broker-id>',
14
+ '<%= config.bin %> <%= command.id %> -n <broker-name>',
14
15
  ];
15
16
  static flags = {
16
17
  'broker-id': Flags.string({
@@ -23,33 +24,35 @@ export default class MissionctrlBrokerOpstatus extends ScCommand {
23
24
  description: 'Name of the event broker service.',
24
25
  exactlyOne: ['broker-id', 'name'],
25
26
  }),
26
- 'operation-id': Flags.string({
27
- char: 'o',
28
- description: 'The identifier of the operation being performed on the event broker service.'
29
- }),
30
27
  'show-progress': Flags.boolean({
31
28
  char: 'p',
32
- description: 'Displays a status bar of the in-progress operation. The command will wait for completion of each step of the operation.'
29
+ description: 'Displays a status bar of the in-progress operations. The command will wait for completion of each step of the operation.',
30
+ }),
31
+ 'wait-ms': Flags.integer({
32
+ char: 'w',
33
+ description: 'The milliseconds to wait between API calls for checking progress of the operation. Default is 5000 ms.',
33
34
  }),
34
35
  };
35
36
  async run() {
36
37
  const { flags } = await this.parse(MissionctrlBrokerOpstatus);
37
38
  const name = flags.name ?? '';
38
39
  let brokerId = flags['broker-id'] ?? '';
39
- const operationId = flags['operation-id'] ?? '';
40
40
  const showProgress = flags['show-progress'] ?? false;
41
+ const waitMs = flags['wait-ms'] ?? 5000;
41
42
  const conn = new ScConnection();
42
- // API url
43
+ // Base API url
43
44
  let apiUrl = `/missionControl/eventBrokerServices`;
44
45
  // If broker name provided, retrieve the broker service id first
45
- // then retrieve the operation status
46
- let rawResp;
46
+ // then retrieve the operation status using the id
47
47
  if (name) {
48
48
  // API call to get broker by name
49
49
  apiUrl += `?customAttributes=name=="${name}"`;
50
50
  const resp = await conn.get(apiUrl);
51
- // TODO FUTURE: show status of multiple brokers operations that match the name
52
- if (resp.data.length > 1) {
51
+ // FUTURE: show status of multiple brokers operations that match the name
52
+ if (resp.data.length === 0) {
53
+ this.error(`No brokers found with name: ${name}.`);
54
+ }
55
+ else if (resp.data.length > 1) {
53
56
  this.error(`Multiple broker services found with: ${name}. Exactly one broker service must match the provided name.`);
54
57
  }
55
58
  else {
@@ -57,53 +60,100 @@ export default class MissionctrlBrokerOpstatus extends ScCommand {
57
60
  }
58
61
  }
59
62
  // API call to retrieve status of the broker operation
60
- apiUrl = `/missionControl/eventBrokerServices/${brokerId}/operations/${operationId}`;
61
- if (showProgress) {
62
- apiUrl += '?expand=progressLogs';
63
- }
64
- let resp = await conn.get(apiUrl);
65
- this.print(resp.data);
66
- // Display progress bar for each step included in the progress logs
67
- // Enable progress bar if set
68
- if (resp.data.progressLogs && resp.data.progressLogs.length > 0) {
69
- let progressLogs = resp.data.progressLogs;
70
- let numSteps = progressLogs.length;
71
- // Create a new progress bar instance and use shades_classic theme
72
- const progressBar = new cliProgress.SingleBar({}, cliProgress.Presets.shades_classic);
73
- // start the progress bar with a total value of size of the steps and start value of 0
74
- progressBar.start(numSteps, 0);
75
- // Update the progress with the steps completed
76
- let completedNumSteps = 0;
77
- while (completedNumSteps < numSteps) {
78
- // Sleep for 5 seconds before making the next API call
79
- await sleep(5000);
80
- // Make another API call to get the lastest progress
81
- resp = await conn.get(apiUrl);
82
- if (resp.data.progressLogs) {
83
- progressLogs = resp.data.progressLogs;
84
- for (const progressLog of progressLogs) {
85
- if (progressLog.step === 'success') {
86
- completedNumSteps++;
87
- }
88
- }
89
- // Update progress bar
63
+ apiUrl = `/missionControl/eventBrokerServices/${brokerId}/operations`;
64
+ const resp = await conn.get(apiUrl);
65
+ const opStatusArray = [
66
+ ['Operation Id', 'Operation Type', 'Status', 'Created Time', 'Completed Time'],
67
+ ...resp.data.map((item) => [
68
+ item.id,
69
+ item.operationType,
70
+ item.status,
71
+ item.createdTime,
72
+ item.completedTime,
73
+ ]),
74
+ ];
75
+ // Display results as a table
76
+ this.log(renderTable(opStatusArray));
77
+ // If show-progress flag is set, display progress bars for each operation
78
+ if (showProgress && resp.data.length > 0) {
79
+ // Create progress bar for each operation
80
+ const multiProgressBar = new MultiBar({
81
+ clearOnComplete: false,
82
+ format: ' {bar} | {operationType} | {value}/{total}',
83
+ hideCursor: true,
84
+ }, Presets.shades_classic);
85
+ // Get the initial progress for each operation
86
+ const progressBars = [];
87
+ let completedOperations = 0;
88
+ let allCompleted = false;
89
+ for (const operationData of resp.data) {
90
+ const opStatusApiUrl = `/missionControl/eventBrokerServices/${brokerId}/operations/${operationData.id}?expand=progressLogs`;
91
+ // eslint-disable-next-line no-await-in-loop
92
+ const opStatusResp = await conn.get(opStatusApiUrl);
93
+ this.debug(`Operation ID: ${operationData.id}, Type: ${operationData.operationType}, Status: ${operationData.status}`);
94
+ if (opStatusResp.data.progressLogs) {
95
+ const numSteps = opStatusResp.data.progressLogs.length;
96
+ // start a new progress bar for the operation with a total value of size of the steps
97
+ const progressBar = multiProgressBar.create(numSteps, 0, { operationType: operationData.operationType });
98
+ // Update the progress with the steps completed
99
+ const completedNumSteps = opStatusResp.data.progressLogs.filter((log) => log.status === 'success').length;
90
100
  progressBar.update(completedNumSteps);
101
+ if (completedNumSteps === numSteps ||
102
+ opStatusResp.data.status === 'SUCCEEDED' ||
103
+ opStatusResp.data.status === 'FAILED') {
104
+ completedOperations += 1;
105
+ progressBar.stop();
106
+ }
107
+ // Add the operation ID and progress bar to the list
108
+ progressBars.push([operationData.id, progressBar]);
91
109
  }
92
- else {
93
- break;
94
- }
95
110
  }
96
- // stop the progress bar
97
- progressBar.stop();
111
+ // Check if all operations are completed
112
+ if (completedOperations === progressBars.length) {
113
+ allCompleted = true;
114
+ }
115
+ // Loop until all operations are completed
116
+ while (!allCompleted) {
117
+ // Wait before making the next API call
118
+ sleep(waitMs);
119
+ // Poll the status of all operations and update the progress bars
120
+ // eslint-disable-next-line no-await-in-loop
121
+ allCompleted = await this.pollAllOperationStatus(conn, brokerId, progressBars);
122
+ }
123
+ multiProgressBar.stop();
124
+ this.log(); // Add a new line for better readability
98
125
  }
99
126
  return resp.data;
100
127
  }
101
- print(environment) {
102
- const tableRows = [
103
- ['Key', 'Value'],
104
- ...Object.entries(environment).map(([key, value]) => [camelCaseToTitleCase(key), value]),
105
- ];
106
- this.log();
107
- this.log(renderKeyValueTable(tableRows));
128
+ async pollAllOperationStatus(conn, brokerId, progressBars) {
129
+ let completedOperations = 0;
130
+ let allCompleted = false;
131
+ // For each operation, get the latest status and update the progress bar
132
+ for (const [operationId, progressBar] of progressBars) {
133
+ const opStatusApiUrl = `/missionControl/eventBrokerServices/${brokerId}/operations/${operationId}?expand=progressLogs`;
134
+ // eslint-disable-next-line no-await-in-loop
135
+ const opStatusResp = await conn.get(opStatusApiUrl);
136
+ if (opStatusResp.data.progressLogs) {
137
+ const numSteps = opStatusResp.data.progressLogs.length;
138
+ const completedNumSteps = opStatusResp.data.progressLogs.filter((log) => log.status === 'success').length;
139
+ // Update progress bar
140
+ progressBar.setTotal(numSteps);
141
+ progressBar.update(completedNumSteps);
142
+ if (completedNumSteps === numSteps ||
143
+ opStatusResp.data.status === 'SUCCEEDED' ||
144
+ opStatusResp.data.status === 'FAILED') {
145
+ completedOperations += 1;
146
+ progressBar.stop();
147
+ }
148
+ }
149
+ else {
150
+ progressBar.stop();
151
+ }
152
+ }
153
+ // Check if all operations are completed
154
+ if (completedOperations === progressBars.length) {
155
+ allCompleted = true;
156
+ }
157
+ return allCompleted;
108
158
  }
109
159
  }
@@ -0,0 +1,15 @@
1
+ import { ScCommand } from '../../../sc-command.js';
2
+ import { EventBrokerOperationDetail } from '../../../types/broker.js';
3
+ export default class MissionctrlBrokerUpdate extends ScCommand<typeof MissionctrlBrokerUpdate> {
4
+ static args: {};
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {
8
+ 'broker-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ locked: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'new-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<EventBrokerOperationDetail>;
14
+ private print;
15
+ }
@@ -0,0 +1,77 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { ScCommand } from '../../../sc-command.js';
3
+ import { camelCaseToTitleCase, renderKeyValueTable } from '../../../util/internal.js';
4
+ import { ScConnection } from '../../../util/sc-connection.js';
5
+ export default class MissionctrlBrokerUpdate extends ScCommand {
6
+ static args = {};
7
+ static description = `Update the configuration of an existing event broker service.
8
+ You can provide any combination of supported flags. If a flag is not provided, then it will not be updated.
9
+
10
+ Your token must have one of the permissions listed in the Token Permissions.
11
+
12
+ Token Permissions: [ mission_control:access or services:put ]`;
13
+ static examples = ['<%= config.bin %> <%= command.id %>'];
14
+ static flags = {
15
+ 'broker-id': Flags.string({
16
+ char: 'b',
17
+ description: 'Id of the event broker service.',
18
+ exactlyOne: ['broker-id', 'name'],
19
+ }),
20
+ locked: Flags.string({
21
+ char: 'l',
22
+ description: `Indicates whether the event broker service has deletion protection enabled. The valid values are 'true' (enabled) or 'false' (disabled).`,
23
+ }),
24
+ name: Flags.string({
25
+ char: 'n',
26
+ description: 'Name of the event broker service.',
27
+ exactlyOne: ['broker-id', 'name'],
28
+ }),
29
+ 'new-name': Flags.string({
30
+ description: 'New name of the event broker service. The new service name must be unique within an organization.',
31
+ }),
32
+ };
33
+ async run() {
34
+ const { flags } = await this.parse(MissionctrlBrokerUpdate);
35
+ const brokerId = flags['broker-id'] ?? '';
36
+ const locked = flags.locked ?? '';
37
+ const lockedBoolValue = locked === 'true';
38
+ const name = flags.name ?? '';
39
+ const newName = flags['new-name'] ?? '';
40
+ // API body
41
+ const body = {
42
+ ...(locked && { locked: lockedBoolValue }),
43
+ ...(newName && { name: newName }),
44
+ };
45
+ const conn = new ScConnection();
46
+ // API url
47
+ let apiUrl = `/missionControl/eventBrokerServices`;
48
+ let brokerIdToUpdate = brokerId;
49
+ if (name) {
50
+ // If broker name provided, get the broker matching provided name. If more than one broker matches, an error will be thrown.
51
+ const resp = await conn.get(`${apiUrl}?customAttributes=name=="${name}"`);
52
+ if (resp.data.length === 0) {
53
+ this.error(`No brokers found with name: ${name}.`);
54
+ }
55
+ else if (resp.data.length > 1) {
56
+ this.error(`Multiple brokers found with name: ${name}. Exactly one event broker service must match the provided name.`);
57
+ }
58
+ else {
59
+ brokerIdToUpdate = resp.data[0]?.id;
60
+ }
61
+ }
62
+ // API call to update broker by id
63
+ apiUrl += `/${brokerIdToUpdate}`;
64
+ const resp = await conn.patch(apiUrl, body);
65
+ this.log(`Broker with id '${brokerIdToUpdate}' has been updated successfully.`);
66
+ this.print(resp.data);
67
+ return resp.data;
68
+ }
69
+ print(broker) {
70
+ const tableRows = [
71
+ ['Key', 'Value'],
72
+ ...Object.entries(broker).map(([key, value]) => [camelCaseToTitleCase(key), value]),
73
+ ];
74
+ this.log();
75
+ this.log(renderKeyValueTable(tableRows));
76
+ }
77
+ }
@@ -5,7 +5,7 @@ export default class PlatformEnvCreate extends ScCommand<typeof PlatformEnvCreat
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
- desc: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  isDefault: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  isProduction: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
@@ -9,7 +9,7 @@ export default class PlatformEnvCreate extends ScCommand {
9
9
  Token Permissions: [ environments:edit ]`;
10
10
  static examples = ['<%= config.bin %> <%= command.id %> --name=MyEnvironment --desc="My environment description" --isDefault --isProduction'];
11
11
  static flags = {
12
- desc: Flags.string({
12
+ description: Flags.string({
13
13
  char: 'd',
14
14
  description: 'Description of the environment to create.'
15
15
  }),
@@ -31,7 +31,7 @@ export default class PlatformEnvCreate extends ScCommand {
31
31
  async run() {
32
32
  const { flags } = await this.parse(PlatformEnvCreate);
33
33
  const name = flags.name ?? '';
34
- const desc = flags.desc ?? '';
34
+ const desc = flags.description ?? '';
35
35
  const isDefault = flags.isDefault ?? false;
36
36
  const isProduction = flags.isProduction ?? false;
37
37
  const conn = new ScConnection();
@@ -39,7 +39,7 @@ export default class PlatformEnvCreate extends ScCommand {
39
39
  const apiUrl = `/platform/environments`;
40
40
  // API body
41
41
  const body = {
42
- description: desc,
42
+ ...(desc && { description: desc }),
43
43
  isDefault,
44
44
  isProduction,
45
45
  name,
@@ -5,7 +5,7 @@ export default class PlatformEnvUpdate extends ScCommand<typeof PlatformEnvUpdat
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
- desc: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  'env-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  isDefault: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -15,7 +15,7 @@ export default class PlatformEnvUpdate extends ScCommand {
15
15
  '<%= config.bin %> <%= command.id %> --env-id=MyEnvId --new-name=MyNewEnvName --desc="My description to update" --isDefault'
16
16
  ];
17
17
  static flags = {
18
- desc: Flags.string({
18
+ description: Flags.string({
19
19
  char: 'd',
20
20
  description: 'Description of the environment to update.'
21
21
  }),
@@ -37,7 +37,7 @@ export default class PlatformEnvUpdate extends ScCommand {
37
37
  };
38
38
  async run() {
39
39
  const { flags } = await this.parse(PlatformEnvUpdate);
40
- const desc = flags.desc ?? '';
40
+ const desc = flags.description ?? '';
41
41
  const envId = flags['env-id'] ?? '';
42
42
  const name = flags.name ?? '';
43
43
  const newName = flags['new-name'] ?? '';
@@ -50,7 +50,7 @@ export default class PlatformEnvUpdate extends ScCommand {
50
50
  const conn = new ScConnection();
51
51
  // API url
52
52
  let apiUrl = `/platform/environments`;
53
- let envIdToUdpate = envId;
53
+ let envIdToUpdate = envId;
54
54
  // If env name provided, get the environment matching provided name and delete. If more than one environment matches, an error will be thrown.
55
55
  // If env id provided, delete environment with that id
56
56
  if (name) {
@@ -61,13 +61,13 @@ export default class PlatformEnvUpdate extends ScCommand {
61
61
  this.error(`Multiple environments found with: ${name}. Exactly one environment must match the provided name.`);
62
62
  }
63
63
  else {
64
- envIdToUdpate = resp.data[0]?.id;
64
+ envIdToUpdate = resp.data[0]?.id;
65
65
  }
66
66
  }
67
- // API call to delete environment by id
68
- apiUrl += `/${envIdToUdpate}`;
67
+ // API call to update environment by id
68
+ apiUrl += `/${envIdToUpdate}`;
69
69
  const resp = await conn.put(apiUrl, body);
70
- this.log(`Environment with id '${envIdToUdpate}' has been updated successfully.`);
70
+ this.log(`Environment with id '${envIdToUpdate}' has been updated successfully.`);
71
71
  this.print(resp.data);
72
72
  return resp.data;
73
73
  }
@@ -1,4 +1,11 @@
1
- export interface EventBrokerCreateDetail {
1
+ export interface ProgressLog {
2
+ message: string;
3
+ status: string;
4
+ step: string;
5
+ stepId: string;
6
+ timestamp: string;
7
+ }
8
+ export interface EventBrokerOperationDetail {
2
9
  completedTime?: string;
3
10
  createdBy?: string;
4
11
  createdTime?: string;
@@ -8,32 +15,40 @@ export interface EventBrokerCreateDetail {
8
15
  };
9
16
  id: string;
10
17
  operationType?: string;
11
- progressLogs?: {
12
- message: string;
13
- step: string;
14
- timestamp: string;
15
- }[];
18
+ progressLogs?: ProgressLog[];
16
19
  resourceId?: string;
17
20
  resourceType?: string;
18
21
  status?: string;
19
22
  type?: string;
20
23
  }
21
- export interface EventBrokerCreateApiResponse {
22
- data: EventBrokerCreateDetail;
23
- meta: {
24
+ export interface EventBrokerOperationApiResponse {
25
+ data: EventBrokerOperationDetail;
26
+ meta?: {
24
27
  additionalProp?: Record<string, unknown>;
25
28
  };
26
29
  }
27
- export interface EventBrokerDeleteListApiResponse {
28
- data: EventBrokerCreateDetail[];
29
- meta: {
30
+ export interface EventBrokerAllOperationsApiResponse {
31
+ data: EventBrokerOperationDetail[];
32
+ meta?: {
30
33
  additionalProp?: Record<string, unknown>;
31
34
  };
32
35
  }
33
36
  export interface EventBrokerListApiResponse {
34
37
  data: EventBrokerServiceDetail[];
35
- meta: {
36
- pagination: {
38
+ meta?: {
39
+ pagination?: {
40
+ count: number;
41
+ nextPage: null | string;
42
+ pageNumber: number;
43
+ pageSize: number;
44
+ totalPages: number;
45
+ };
46
+ };
47
+ }
48
+ export interface EventBrokerApiResponse {
49
+ data: EventBrokerServiceDetail;
50
+ meta?: {
51
+ pagination?: {
37
52
  count: number;
38
53
  nextPage: null | string;
39
54
  pageNumber: number;
@@ -44,42 +59,136 @@ export interface EventBrokerListApiResponse {
44
59
  }
45
60
  export interface EventBrokerServiceDetail {
46
61
  adminState?: string;
62
+ allowedActions?: string[];
63
+ broker?: {
64
+ clientCertificateAuthorities?: Array<{
65
+ name: string;
66
+ }>;
67
+ cluster?: {
68
+ backupRouterName?: string;
69
+ monitoringRouterName?: string;
70
+ name?: string;
71
+ password?: string;
72
+ primaryRouterName?: string;
73
+ remoteAddress?: string;
74
+ supportedAuthenticationMode?: string[];
75
+ };
76
+ configSyncSslEnabled?: boolean;
77
+ diskSize?: number;
78
+ domainCertificateAuthorities?: Array<{
79
+ name: string;
80
+ }>;
81
+ ldapProfiles?: Array<{
82
+ name: string;
83
+ }>;
84
+ managementReadOnlyLoginCredential?: {
85
+ password?: string;
86
+ token?: string;
87
+ username?: string;
88
+ };
89
+ maxSpoolUsage?: number;
90
+ monitoringAgentEnabled?: boolean;
91
+ monitoringMode?: string;
92
+ msgVpns?: Array<{
93
+ authenticationBasicEnabled?: boolean;
94
+ authenticationBasicType?: string;
95
+ authenticationClientCertAllowApiProvidedUsernameEnabled?: boolean;
96
+ authenticationClientCertEnabled?: boolean;
97
+ authenticationClientCertUsernameSource?: string;
98
+ authenticationClientCertValidateDateEnabled?: boolean;
99
+ authenticationOauthEnabled?: boolean;
100
+ clientProfiles?: Array<{
101
+ name: string;
102
+ }>;
103
+ enabled?: boolean;
104
+ eventLargeMsgThreshold?: number;
105
+ managementAdminLoginCredential?: {
106
+ password?: string;
107
+ token?: string;
108
+ username?: string;
109
+ };
110
+ maxConnectionCount?: number;
111
+ maxEgressFlowCount?: number;
112
+ maxEndpointCount?: number;
113
+ maxIngressFlowCount?: number;
114
+ maxMsgSpoolUsage?: number;
115
+ maxSubscriptionCount?: number;
116
+ maxTransactedSessionCount?: number;
117
+ maxTransactionCount?: number;
118
+ missionControlManagerLoginCredential?: {
119
+ password?: string;
120
+ token?: string;
121
+ username?: string;
122
+ };
123
+ msgVpnName?: string;
124
+ sempOverMessageBus?: {
125
+ sempAccessToAdminCmdsEnabled?: boolean;
126
+ sempAccessToCacheCmdsEnabled?: boolean;
127
+ sempAccessToClientAdminCmdsEnabled?: boolean;
128
+ sempAccessToShowCmdsEnabled?: boolean;
129
+ sempOverMsgBusEnabled?: boolean;
130
+ };
131
+ serviceLoginCredential?: {
132
+ password?: string;
133
+ username?: string;
134
+ };
135
+ subDomainName?: string;
136
+ truststoreUri?: string;
137
+ }>;
138
+ redundancyGroupSslEnabled?: boolean;
139
+ solaceDatadogAgentImage?: string;
140
+ tlsStandardDomainCertificateAuthoritiesEnabled?: boolean;
141
+ version?: string;
142
+ versionFamily?: string;
143
+ };
144
+ createdBy?: string;
47
145
  createdTime?: string;
48
146
  creationState?: string;
49
147
  datacenterId?: string;
148
+ defaultManagementHostname?: string;
50
149
  environmentId?: string;
150
+ errorId?: string;
151
+ errorMessage?: string;
51
152
  eventBrokerServiceVersion?: string;
153
+ eventBrokerServiceVersionDetails?: {
154
+ releaseStatus?: string;
155
+ releaseStatusDetails?: string;
156
+ };
157
+ eventMeshId?: string;
52
158
  id: string;
159
+ infrastructureDetails?: {
160
+ backupNodeHostname?: string;
161
+ infrastructureId?: string;
162
+ monitoringNodeHostname?: string;
163
+ primaryNodeHostname?: string;
164
+ };
53
165
  infrastructureId?: string;
54
166
  locked?: boolean;
167
+ messageSpoolDetails?: {
168
+ defaultGbSize?: number;
169
+ expandedGbBilled?: number;
170
+ totalGbSize?: number;
171
+ };
55
172
  msgVpnName?: string;
56
173
  name: string;
174
+ ongoingOperationIds?: string[];
57
175
  ownedBy?: string;
58
176
  serviceClassId?: string;
177
+ serviceConnectionEndpoints?: Array<{
178
+ accessType?: string;
179
+ description?: string;
180
+ hostNames?: string[];
181
+ id?: string;
182
+ k8sServiceId?: string;
183
+ k8sServiceType?: string;
184
+ name?: string;
185
+ ports?: Array<{
186
+ port?: number;
187
+ protocol?: string;
188
+ }>;
189
+ type?: string;
190
+ }>;
59
191
  type?: string;
60
- }
61
- /**
62
- * For Broker Operation Status
63
- */
64
- export interface OperationResponse {
65
- data: OperationData;
66
- }
67
- export interface OperationData {
68
- id: string;
69
- type: "operation";
70
- operationType: string;
71
- createdBy: string;
72
- createdTime: string;
73
- completedTime: string;
74
- resourceId: string;
75
- resourceType: string;
76
- progressLogs?: ProgressLog[];
77
- status: string;
78
- }
79
- export interface ProgressLog {
80
- step: string;
81
- message: string;
82
- timestamp: string;
83
- stepId: string;
84
- status: string;
192
+ updatedBy?: string;
193
+ updatedTime?: string;
85
194
  }
@@ -13,6 +13,9 @@ export declare function renderKeyValueTable<T>(data: T[][], columnConfig?: Recor
13
13
  /**
14
14
  * Sleep function.
15
15
  * @param ms Num of milliseconds to wait
16
- * @returns
16
+ * @returns Promise that resolves after the specified time
17
17
  */
18
18
  export declare function sleep(ms: number): Promise<void>;
19
+ export declare const sleepModule: {
20
+ sleep: typeof sleep;
21
+ };
@@ -36,8 +36,11 @@ export function renderKeyValueTable(data, columnConfig) {
36
36
  /**
37
37
  * Sleep function.
38
38
  * @param ms Num of milliseconds to wait
39
- * @returns
39
+ * @returns Promise that resolves after the specified time
40
40
  */
41
41
  export function sleep(ms) {
42
- return new Promise(resolve => setTimeout(resolve, ms));
42
+ return new Promise((resolve) => {
43
+ setTimeout(resolve, ms);
44
+ });
43
45
  }
46
+ export const sleepModule = { sleep };
@@ -5,6 +5,7 @@ export declare class ScConnection {
5
5
  constructor(baseURL?: string, accessToken?: string, timeout?: number);
6
6
  delete<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
7
7
  get<T>(url: string, config?: AxiosRequestConfig): Promise<T>;
8
+ patch<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
8
9
  post<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
9
10
  put<T>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
10
11
  private joinPaths;
@@ -30,6 +30,11 @@ export class ScConnection {
30
30
  const response = await this.axiosInstance.get(url, config);
31
31
  return response.data;
32
32
  }
33
+ // PATCH request
34
+ async patch(url, data, config) {
35
+ const response = await this.axiosInstance.patch(url, data, config);
36
+ return response.data;
37
+ }
33
38
  // POST request
34
39
  async post(url, data, config) {
35
40
  const response = await this.axiosInstance.post(url, data, config);
@@ -334,9 +334,10 @@
334
334
  "missionctrl:broker:opstatus": {
335
335
  "aliases": [],
336
336
  "args": {},
337
- "description": "Get the status of an operation that being performed on an event broker service. \n To get the operation, you provide identifier of the operation and the identifier of the event broker service.\n\n Token Permissions: [ mission_control:access or services:get or services:get:self or services:view or services:view:self ]",
337
+ "description": "Get the status of all operations being performed on an event broker service. \n To get the operation status, you must provide the identifier or name of the event broker service.\n\n Token Permissions: [ mission_control:access or services:get or services:get:self or services:view or services:view:self ]",
338
338
  "examples": [
339
- "<%= config.bin %> <%= command.id %>"
339
+ "<%= config.bin %> <%= command.id %> -b <broker-id>",
340
+ "<%= config.bin %> <%= command.id %> -n <broker-name>"
340
341
  ],
341
342
  "flags": {
342
343
  "json": {
@@ -378,20 +379,20 @@
378
379
  "multiple": false,
379
380
  "type": "option"
380
381
  },
381
- "operation-id": {
382
- "char": "o",
383
- "description": "The identifier of the operation being performed on the event broker service.",
384
- "name": "operation-id",
385
- "hasDynamicHelp": false,
386
- "multiple": false,
387
- "type": "option"
388
- },
389
382
  "show-progress": {
390
383
  "char": "p",
391
- "description": "Displays a status bar of the in-progress operation. The command will wait for completion of each step of the operation.",
384
+ "description": "Displays a status bar of the in-progress operations. The command will wait for completion of each step of the operation.",
392
385
  "name": "show-progress",
393
386
  "allowNo": false,
394
387
  "type": "boolean"
388
+ },
389
+ "wait-ms": {
390
+ "char": "w",
391
+ "description": "The milliseconds to wait between API calls for checking progress of the operation. Default is 5000 ms.",
392
+ "name": "wait-ms",
393
+ "hasDynamicHelp": false,
394
+ "multiple": false,
395
+ "type": "option"
395
396
  }
396
397
  },
397
398
  "hasDynamicHelp": false,
@@ -411,6 +412,86 @@
411
412
  "opstatus.js"
412
413
  ]
413
414
  },
415
+ "missionctrl:broker:update": {
416
+ "aliases": [],
417
+ "args": {},
418
+ "description": "Update the configuration of an existing event broker service. \n You can provide any combination of supported flags. If a flag is not provided, then it will not be updated.\n \n Your token must have one of the permissions listed in the Token Permissions.\n\n Token Permissions: [ mission_control:access or services:put ]",
419
+ "examples": [
420
+ "<%= config.bin %> <%= command.id %>"
421
+ ],
422
+ "flags": {
423
+ "json": {
424
+ "description": "Format output as json.",
425
+ "helpGroup": "GLOBAL",
426
+ "name": "json",
427
+ "allowNo": false,
428
+ "type": "boolean"
429
+ },
430
+ "log-level": {
431
+ "helpGroup": "GLOBAL",
432
+ "name": "log-level",
433
+ "summary": "Specify level for logging.",
434
+ "default": "info",
435
+ "hasDynamicHelp": false,
436
+ "multiple": false,
437
+ "options": [
438
+ "debug",
439
+ "warn",
440
+ "error",
441
+ "info",
442
+ "trace"
443
+ ],
444
+ "type": "option"
445
+ },
446
+ "broker-id": {
447
+ "char": "b",
448
+ "description": "Id of the event broker service.",
449
+ "name": "broker-id",
450
+ "hasDynamicHelp": false,
451
+ "multiple": false,
452
+ "type": "option"
453
+ },
454
+ "locked": {
455
+ "char": "l",
456
+ "description": "Indicates whether the event broker service has deletion protection enabled. The valid values are 'true' (enabled) or 'false' (disabled).",
457
+ "name": "locked",
458
+ "hasDynamicHelp": false,
459
+ "multiple": false,
460
+ "type": "option"
461
+ },
462
+ "name": {
463
+ "char": "n",
464
+ "description": "Name of the event broker service.",
465
+ "name": "name",
466
+ "hasDynamicHelp": false,
467
+ "multiple": false,
468
+ "type": "option"
469
+ },
470
+ "new-name": {
471
+ "description": "New name of the event broker service. The new service name must be unique within an organization.",
472
+ "name": "new-name",
473
+ "hasDynamicHelp": false,
474
+ "multiple": false,
475
+ "type": "option"
476
+ }
477
+ },
478
+ "hasDynamicHelp": false,
479
+ "hiddenAliases": [],
480
+ "id": "missionctrl:broker:update",
481
+ "pluginAlias": "@dishantlangayan/solace-cloud-cli",
482
+ "pluginName": "@dishantlangayan/solace-cloud-cli",
483
+ "pluginType": "core",
484
+ "strict": true,
485
+ "enableJsonFlag": true,
486
+ "isESM": true,
487
+ "relativePath": [
488
+ "dist",
489
+ "commands",
490
+ "missionctrl",
491
+ "broker",
492
+ "update.js"
493
+ ]
494
+ },
414
495
  "platform:env:create": {
415
496
  "aliases": [],
416
497
  "args": {},
@@ -442,10 +523,10 @@
442
523
  ],
443
524
  "type": "option"
444
525
  },
445
- "desc": {
526
+ "description": {
446
527
  "char": "d",
447
528
  "description": "Description of the environment to create.",
448
- "name": "desc",
529
+ "name": "description",
449
530
  "hasDynamicHelp": false,
450
531
  "multiple": false,
451
532
  "type": "option"
@@ -734,10 +815,10 @@
734
815
  ],
735
816
  "type": "option"
736
817
  },
737
- "desc": {
818
+ "description": {
738
819
  "char": "d",
739
820
  "description": "Description of the environment to update.",
740
- "name": "desc",
821
+ "name": "description",
741
822
  "hasDynamicHelp": false,
742
823
  "multiple": false,
743
824
  "type": "option"
@@ -790,5 +871,5 @@
790
871
  ]
791
872
  }
792
873
  },
793
- "version": "0.0.3"
874
+ "version": "0.0.4"
794
875
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dishantlangayan/solace-cloud-cli",
3
3
  "description": "The Solace Cloud CLI",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "author": "Dishant Langayan",
6
6
  "bin": {
7
7
  "sc": "./bin/run.js"