@dishantlangayan/solace-cloud-cli 0.1.0 → 0.2.0
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 +106 -23
- package/dist/commands/missionctrl/broker/create.d.ts +3 -4
- package/dist/commands/missionctrl/broker/create.js +3 -14
- package/dist/commands/missionctrl/broker/delete.d.ts +3 -4
- package/dist/commands/missionctrl/broker/delete.js +3 -13
- package/dist/commands/missionctrl/broker/display.d.ts +3 -4
- package/dist/commands/missionctrl/broker/display.js +6 -15
- package/dist/commands/missionctrl/broker/list.d.ts +3 -3
- package/dist/commands/missionctrl/broker/list.js +9 -9
- package/dist/commands/missionctrl/broker/opstatus.d.ts +1 -1
- package/dist/commands/missionctrl/broker/opstatus.js +1 -3
- package/dist/commands/missionctrl/broker/state.d.ts +12 -0
- package/dist/commands/missionctrl/broker/state.js +52 -0
- package/dist/commands/missionctrl/broker/update.d.ts +3 -4
- package/dist/commands/missionctrl/broker/update.js +8 -14
- package/dist/commands/platform/env/create.d.ts +3 -4
- package/dist/commands/platform/env/create.js +10 -19
- package/dist/commands/platform/env/delete.d.ts +1 -1
- package/dist/commands/platform/env/delete.js +7 -5
- package/dist/commands/platform/env/display.d.ts +3 -4
- package/dist/commands/platform/env/display.js +14 -26
- package/dist/commands/platform/env/list.d.ts +3 -3
- package/dist/commands/platform/env/list.js +9 -9
- package/dist/commands/platform/env/update.d.ts +3 -4
- package/dist/commands/platform/env/update.js +12 -22
- package/dist/types/broker.d.ts +15 -0
- package/dist/types/environment.d.ts +2 -2
- package/oclif.manifest.json +77 -8
- package/package.json +7 -8
- package/dist/sc-command.d.ts +0 -22
- package/dist/sc-command.js +0 -54
- package/dist/util/internal.d.ts +0 -21
- package/dist/util/internal.js +0 -46
- package/dist/util/json.d.ts +0 -15
- package/dist/util/json.js +0 -19
- package/dist/util/sc-connection.d.ts +0 -13
- package/dist/util/sc-connection.js +0 -52
|
@@ -1,23 +1,23 @@
|
|
|
1
|
+
import { printObjectAsKeyValueTable, ScCommand, ScConnection } from '@dishantlangayan/sc-cli-core';
|
|
1
2
|
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
3
|
export default class PlatformEnvCreate extends ScCommand {
|
|
6
4
|
static args = {};
|
|
7
5
|
static description = `Create a new environment.
|
|
8
6
|
|
|
9
7
|
Token Permissions: [ environments:edit ]`;
|
|
10
|
-
static examples = [
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --name=MyEnvironment --description="My environment description" --isDefault --isProduction',
|
|
10
|
+
];
|
|
11
11
|
static flags = {
|
|
12
12
|
description: Flags.string({
|
|
13
13
|
char: 'd',
|
|
14
|
-
description: 'Description of the environment to create.'
|
|
14
|
+
description: 'Description of the environment to create.',
|
|
15
15
|
}),
|
|
16
16
|
isDefault: Flags.boolean({
|
|
17
|
-
description:
|
|
17
|
+
description: `Indicates this is the organization's default environment.`,
|
|
18
18
|
}),
|
|
19
19
|
isProduction: Flags.boolean({
|
|
20
|
-
description: `Indicates this is an organization
|
|
20
|
+
description: `Indicates this is an organization's production environment.
|
|
21
21
|
This is an immutable field. If an environment needs to be migrated,
|
|
22
22
|
architecture can be migrated to a new environment with the desired
|
|
23
23
|
environment type instead.`,
|
|
@@ -25,7 +25,7 @@ export default class PlatformEnvCreate extends ScCommand {
|
|
|
25
25
|
name: Flags.string({
|
|
26
26
|
char: 'n',
|
|
27
27
|
description: 'Name of the environment to create.',
|
|
28
|
-
required: true
|
|
28
|
+
required: true,
|
|
29
29
|
}),
|
|
30
30
|
};
|
|
31
31
|
async run() {
|
|
@@ -47,17 +47,8 @@ export default class PlatformEnvCreate extends ScCommand {
|
|
|
47
47
|
// API call
|
|
48
48
|
const resp = await conn.post(apiUrl, body);
|
|
49
49
|
// Display results
|
|
50
|
-
this.log(
|
|
51
|
-
this.print(resp.data);
|
|
50
|
+
this.log(printObjectAsKeyValueTable(resp.data));
|
|
52
51
|
// Return raw json if --json flag is set
|
|
53
|
-
return resp
|
|
54
|
-
}
|
|
55
|
-
print(environment) {
|
|
56
|
-
const tableRows = [
|
|
57
|
-
['Key', 'Value'],
|
|
58
|
-
...Object.entries(environment).map(([key, value]) => [camelCaseToTitleCase(key), value]),
|
|
59
|
-
];
|
|
60
|
-
this.log();
|
|
61
|
-
this.log(renderKeyValueTable(tableRows));
|
|
52
|
+
return resp;
|
|
62
53
|
}
|
|
63
54
|
}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import { ScCommand, ScConnection } from '@dishantlangayan/sc-cli-core';
|
|
1
2
|
import { Flags } from '@oclif/core';
|
|
2
|
-
import { ScCommand } from '../../../sc-command.js';
|
|
3
|
-
import { ScConnection } from '../../../util/sc-connection.js';
|
|
4
3
|
export default class PlatformEnvDelete extends ScCommand {
|
|
5
4
|
static args = {};
|
|
6
5
|
static description = `Delete an environment using either its name or unique identifier. The default environment cannot be deleted.
|
|
7
6
|
|
|
8
7
|
Token Permissions: [ environments:edit ]`;
|
|
9
|
-
static examples = [
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --name=MyEnvName',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --env-id=MyEnvId',
|
|
11
|
+
];
|
|
10
12
|
static flags = {
|
|
11
13
|
'env-id': Flags.string({
|
|
12
14
|
char: 'e',
|
|
13
15
|
description: 'Id of the environment.',
|
|
14
|
-
exactlyOne: ['env-id', 'name']
|
|
16
|
+
exactlyOne: ['env-id', 'name'],
|
|
15
17
|
}),
|
|
16
18
|
name: Flags.string({
|
|
17
19
|
char: 'n',
|
|
18
20
|
description: 'Name of the environment.',
|
|
19
|
-
exactlyOne: ['env-id', 'name']
|
|
21
|
+
exactlyOne: ['env-id', 'name'],
|
|
20
22
|
}),
|
|
21
23
|
};
|
|
22
24
|
async run() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ScCommand } from '
|
|
2
|
-
import {
|
|
1
|
+
import { ScCommand } from '@dishantlangayan/sc-cli-core';
|
|
2
|
+
import { EnvironmentApiResponse, EnvironmentListApiResponse } from '../../../types/environment.js';
|
|
3
3
|
export default class PlatformEnvDisplay extends ScCommand<typeof PlatformEnvDisplay> {
|
|
4
4
|
static args: {};
|
|
5
5
|
static description: string;
|
|
@@ -8,6 +8,5 @@ export default class PlatformEnvDisplay extends ScCommand<typeof PlatformEnvDisp
|
|
|
8
8
|
'env-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
10
|
};
|
|
11
|
-
run(): Promise<
|
|
12
|
-
private print;
|
|
11
|
+
run(): Promise<EnvironmentApiResponse | EnvironmentListApiResponse>;
|
|
13
12
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import { printObjectAsKeyValueTable, ScCommand, ScConnection } from '@dishantlangayan/sc-cli-core';
|
|
1
2
|
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
3
|
export default class PlatformEnvDisplay extends ScCommand {
|
|
6
4
|
static args = {};
|
|
7
5
|
static description = `Display information about an Environment.
|
|
@@ -9,17 +7,20 @@ export default class PlatformEnvDisplay extends ScCommand {
|
|
|
9
7
|
Use either the Environment's ID (--env-id) or name of the Environment (--name).
|
|
10
8
|
|
|
11
9
|
Required token permissions: [ environments:view ]`;
|
|
12
|
-
static examples = [
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --name=MyEnvName',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --env-id=MyEnvId',
|
|
13
|
+
];
|
|
13
14
|
static flags = {
|
|
14
15
|
'env-id': Flags.string({
|
|
15
16
|
char: 'e',
|
|
16
17
|
description: 'Id of the environment.',
|
|
17
|
-
exactlyOne: ['env-id', 'name']
|
|
18
|
+
exactlyOne: ['env-id', 'name'],
|
|
18
19
|
}),
|
|
19
20
|
name: Flags.string({
|
|
20
21
|
char: 'n',
|
|
21
22
|
description: 'Name of the environment.',
|
|
22
|
-
exactlyOne: ['env-id', 'name']
|
|
23
|
+
exactlyOne: ['env-id', 'name'],
|
|
23
24
|
}),
|
|
24
25
|
};
|
|
25
26
|
async run() {
|
|
@@ -31,35 +32,22 @@ export default class PlatformEnvDisplay extends ScCommand {
|
|
|
31
32
|
// If env name provided, get all environments matching provided name
|
|
32
33
|
// If env id provided, get environment with that id
|
|
33
34
|
let apiUrl = `/platform/environments`;
|
|
34
|
-
let
|
|
35
|
+
let resp;
|
|
35
36
|
if (envId) {
|
|
36
37
|
// API call to get environment by id
|
|
37
38
|
apiUrl += `/${envId}`;
|
|
38
|
-
|
|
39
|
-
this.
|
|
40
|
-
rawResp = [resp.data];
|
|
39
|
+
resp = await conn.get(apiUrl);
|
|
40
|
+
this.log(printObjectAsKeyValueTable(resp.data));
|
|
41
41
|
}
|
|
42
|
-
else
|
|
42
|
+
else {
|
|
43
43
|
// API call to get environment by name
|
|
44
44
|
apiUrl += `?name=${name}`;
|
|
45
|
-
|
|
45
|
+
resp = await conn.get(apiUrl);
|
|
46
46
|
for (const env of resp.data) {
|
|
47
|
-
this.
|
|
47
|
+
this.log(printObjectAsKeyValueTable(env));
|
|
48
48
|
}
|
|
49
|
-
rawResp = resp.data;
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
this.error('Either --env-id or --name must be provided.');
|
|
53
49
|
}
|
|
54
50
|
// Return raw json if --json flag is set
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
print(environment) {
|
|
58
|
-
const tableRows = [
|
|
59
|
-
['Key', 'Value'],
|
|
60
|
-
...Object.entries(environment).map(([key, value]) => [camelCaseToTitleCase(key), value]),
|
|
61
|
-
];
|
|
62
|
-
this.log();
|
|
63
|
-
this.log(renderKeyValueTable(tableRows));
|
|
51
|
+
return resp;
|
|
64
52
|
}
|
|
65
53
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ScCommand } from '
|
|
2
|
-
import {
|
|
1
|
+
import { ScCommand } from '@dishantlangayan/sc-cli-core';
|
|
2
|
+
import { EnvironmentListApiResponse } from '../../../types/environment.js';
|
|
3
3
|
export default class PlatformEnvList extends ScCommand<typeof PlatformEnvList> {
|
|
4
4
|
static args: {};
|
|
5
5
|
static description: string;
|
|
@@ -10,5 +10,5 @@ export default class PlatformEnvList extends ScCommand<typeof PlatformEnvList> {
|
|
|
10
10
|
pageSize: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
sort: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
};
|
|
13
|
-
run(): Promise<
|
|
13
|
+
run(): Promise<EnvironmentListApiResponse>;
|
|
14
14
|
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
import { renderTable, ScCommand, ScConnection } from '@dishantlangayan/sc-cli-core';
|
|
1
2
|
import { Flags } from '@oclif/core';
|
|
2
|
-
import { ScCommand } from '../../../sc-command.js';
|
|
3
|
-
import { renderTable } from '../../../util/internal.js';
|
|
4
|
-
import { ScConnection } from '../../../util/sc-connection.js';
|
|
5
3
|
export default class PlatformEnvList extends ScCommand {
|
|
6
4
|
static args = {};
|
|
7
5
|
static description = `Get a list of all Environments.
|
|
8
6
|
|
|
9
7
|
Required token permissions: [ environments:view ]`;
|
|
10
|
-
static examples = [
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --name=Default --pageNumber=1 --pageSize=10 --sort=name:ASC',
|
|
11
|
+
];
|
|
11
12
|
static flags = {
|
|
12
13
|
name: Flags.string({
|
|
13
14
|
char: 'n',
|
|
14
|
-
description: 'Name of the environment to match on.'
|
|
15
|
+
description: 'Name of the environment to match on.',
|
|
15
16
|
}),
|
|
16
17
|
pageNumber: Flags.integer({
|
|
17
18
|
char: 'p',
|
|
18
|
-
description: 'The page number to get. Defaults to 10'
|
|
19
|
+
description: 'The page number to get. Defaults to 10',
|
|
19
20
|
}),
|
|
20
21
|
pageSize: Flags.integer({
|
|
21
22
|
char: 's',
|
|
@@ -48,12 +49,11 @@ export default class PlatformEnvList extends ScCommand {
|
|
|
48
49
|
item.isDefault,
|
|
49
50
|
item.isProduction,
|
|
50
51
|
item.description,
|
|
51
|
-
])
|
|
52
|
+
]),
|
|
52
53
|
];
|
|
53
54
|
// Display results as a table
|
|
54
|
-
this.log();
|
|
55
55
|
this.log(renderTable(envArray, { 4: { width: 50, wrapWord: true } }));
|
|
56
56
|
// Return raw json if --json flag is set
|
|
57
|
-
return resp
|
|
57
|
+
return resp;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ScCommand } from '
|
|
2
|
-
import {
|
|
1
|
+
import { ScCommand } from '@dishantlangayan/sc-cli-core';
|
|
2
|
+
import { EnvironmentApiResponse } from '../../../types/environment.js';
|
|
3
3
|
export default class PlatformEnvUpdate extends ScCommand<typeof PlatformEnvUpdate> {
|
|
4
4
|
static args: {};
|
|
5
5
|
static description: string;
|
|
@@ -11,6 +11,5 @@ export default class PlatformEnvUpdate extends ScCommand<typeof PlatformEnvUpdat
|
|
|
11
11
|
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
12
|
'new-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
13
|
};
|
|
14
|
-
run(): Promise<
|
|
15
|
-
private print;
|
|
14
|
+
run(): Promise<EnvironmentApiResponse>;
|
|
16
15
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import { printObjectAsKeyValueTable, ScCommand, ScConnection } from '@dishantlangayan/sc-cli-core';
|
|
1
2
|
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
3
|
export default class PlatformEnvUpdate extends ScCommand {
|
|
6
4
|
static args = {};
|
|
7
5
|
static description = `Modify an environment's attributes
|
|
@@ -11,28 +9,29 @@ export default class PlatformEnvUpdate extends ScCommand {
|
|
|
11
9
|
Token Permissions: [ environments:edit ]
|
|
12
10
|
`;
|
|
13
11
|
static examples = [
|
|
14
|
-
'<%= config.bin %> <%= command.id %> --name=MyEnvName --new-name=MyNewEnvName --
|
|
15
|
-
'<%= config.bin %> <%= command.id %> --env-id=MyEnvId --new-name=MyNewEnvName --
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --name=MyEnvName --new-name=MyNewEnvName --description="My description to update" --isDefault',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --env-id=MyEnvId --new-name=MyNewEnvName --description="My description to update" --isDefault',
|
|
16
14
|
];
|
|
17
15
|
static flags = {
|
|
18
16
|
description: Flags.string({
|
|
19
17
|
char: 'd',
|
|
20
|
-
description: 'Description of the environment to update.'
|
|
18
|
+
description: 'Description of the environment to update.',
|
|
21
19
|
}),
|
|
22
20
|
'env-id': Flags.string({
|
|
23
21
|
char: 'e',
|
|
24
22
|
description: 'Id of the environment.',
|
|
25
|
-
exactlyOne: ['env-id', 'name']
|
|
23
|
+
exactlyOne: ['env-id', 'name'],
|
|
26
24
|
}),
|
|
27
25
|
isDefault: Flags.boolean({
|
|
28
|
-
description: `Indicates this is the organization's default environment. The default value is false
|
|
26
|
+
description: `Indicates this is the organization's default environment. The default value is false.`,
|
|
29
27
|
}),
|
|
30
28
|
name: Flags.string({
|
|
31
|
-
char: 'n',
|
|
32
|
-
|
|
29
|
+
char: 'n',
|
|
30
|
+
description: 'Current name of the environment.',
|
|
31
|
+
exactlyOne: ['env-id', 'name'],
|
|
33
32
|
}),
|
|
34
33
|
'new-name': Flags.string({
|
|
35
|
-
description: 'New name of the environment.'
|
|
34
|
+
description: 'New name of the environment.',
|
|
36
35
|
}),
|
|
37
36
|
};
|
|
38
37
|
async run() {
|
|
@@ -67,16 +66,7 @@ export default class PlatformEnvUpdate extends ScCommand {
|
|
|
67
66
|
// API call to update environment by id
|
|
68
67
|
apiUrl += `/${envIdToUpdate}`;
|
|
69
68
|
const resp = await conn.put(apiUrl, body);
|
|
70
|
-
this.log(
|
|
71
|
-
|
|
72
|
-
return resp.data;
|
|
73
|
-
}
|
|
74
|
-
print(environment) {
|
|
75
|
-
const tableRows = [
|
|
76
|
-
['Key', 'Value'],
|
|
77
|
-
...Object.entries(environment).map(([key, value]) => [camelCaseToTitleCase(key), value]),
|
|
78
|
-
];
|
|
79
|
-
this.log();
|
|
80
|
-
this.log(renderKeyValueTable(tableRows));
|
|
69
|
+
this.log(printObjectAsKeyValueTable(resp.data));
|
|
70
|
+
return resp;
|
|
81
71
|
}
|
|
82
72
|
}
|
package/dist/types/broker.d.ts
CHANGED
|
@@ -57,6 +57,21 @@ export interface EventBrokerApiResponse {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
+
export interface EventBrokerRedundancyApiResponse {
|
|
61
|
+
data: {
|
|
62
|
+
id: string;
|
|
63
|
+
isHighAvailability: boolean;
|
|
64
|
+
redundancy: {
|
|
65
|
+
activeNode: string;
|
|
66
|
+
configSync: string;
|
|
67
|
+
redundancy: string;
|
|
68
|
+
};
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
meta?: {
|
|
72
|
+
additionalProp?: Record<string, unknown>;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
60
75
|
export interface EventBrokerServiceDetail {
|
|
61
76
|
adminState?: string;
|
|
62
77
|
allowedActions?: string[];
|
|
@@ -19,7 +19,7 @@ export interface Environment {
|
|
|
19
19
|
updatedBy?: string;
|
|
20
20
|
updatedTime?: string;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface EnvironmentListApiResponse {
|
|
23
23
|
data: Environment[];
|
|
24
24
|
meta: {
|
|
25
25
|
pagination: {
|
|
@@ -31,6 +31,6 @@ export interface EnvironmentApiResponse {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
export interface
|
|
34
|
+
export interface EnvironmentApiResponse {
|
|
35
35
|
data: Environment;
|
|
36
36
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -258,6 +258,7 @@
|
|
|
258
258
|
"args": {},
|
|
259
259
|
"description": "Get a listing of event broker services.\n\nYour token must have one of the permissions listed in the Token Permissions.\n\nToken Permissions: [ `mission_control:access` **or** `services:get` **or** `services:get:self` **or** `services:view` **or** `services:view:self` ]",
|
|
260
260
|
"examples": [
|
|
261
|
+
"<%= config.bin %> <%= command.id %>",
|
|
261
262
|
"<%= config.bin %> <%= command.id %> --name=MyBrokerName --pageNumber=1 --pageSize=10 --sort=name:asc"
|
|
262
263
|
],
|
|
263
264
|
"flags": {
|
|
@@ -300,7 +301,7 @@
|
|
|
300
301
|
"type": "option"
|
|
301
302
|
},
|
|
302
303
|
"pageSize": {
|
|
303
|
-
"description": "The number of event broker services to return per page. Defaults to
|
|
304
|
+
"description": "The number of event broker services to return per page. Defaults to 10",
|
|
304
305
|
"name": "pageSize",
|
|
305
306
|
"hasDynamicHelp": false,
|
|
306
307
|
"multiple": false,
|
|
@@ -412,12 +413,80 @@
|
|
|
412
413
|
"opstatus.js"
|
|
413
414
|
]
|
|
414
415
|
},
|
|
416
|
+
"missionctrl:broker:state": {
|
|
417
|
+
"aliases": [],
|
|
418
|
+
"args": {},
|
|
419
|
+
"description": "Get the availability state of an event broker service and the name of the active messaging node using the service's unique identifier.\n\n Your token must have one of the permissions listed in the Token Permissions.\n \n Token Permissions: [ mission_control:access or services:get or services:get:self or services:view or services:view:self ]",
|
|
420
|
+
"examples": [
|
|
421
|
+
"<%= config.bin %> <%= command.id %> --broker-id=MyBrokerServiceId",
|
|
422
|
+
"<%= config.bin %> <%= command.id %> --name=MyBrokerName"
|
|
423
|
+
],
|
|
424
|
+
"flags": {
|
|
425
|
+
"json": {
|
|
426
|
+
"description": "Format output as json.",
|
|
427
|
+
"helpGroup": "GLOBAL",
|
|
428
|
+
"name": "json",
|
|
429
|
+
"allowNo": false,
|
|
430
|
+
"type": "boolean"
|
|
431
|
+
},
|
|
432
|
+
"log-level": {
|
|
433
|
+
"helpGroup": "GLOBAL",
|
|
434
|
+
"name": "log-level",
|
|
435
|
+
"summary": "Specify level for logging.",
|
|
436
|
+
"default": "info",
|
|
437
|
+
"hasDynamicHelp": false,
|
|
438
|
+
"multiple": false,
|
|
439
|
+
"options": [
|
|
440
|
+
"debug",
|
|
441
|
+
"warn",
|
|
442
|
+
"error",
|
|
443
|
+
"info",
|
|
444
|
+
"trace"
|
|
445
|
+
],
|
|
446
|
+
"type": "option"
|
|
447
|
+
},
|
|
448
|
+
"broker-id": {
|
|
449
|
+
"char": "b",
|
|
450
|
+
"description": "Id of the event broker service.",
|
|
451
|
+
"name": "broker-id",
|
|
452
|
+
"hasDynamicHelp": false,
|
|
453
|
+
"multiple": false,
|
|
454
|
+
"type": "option"
|
|
455
|
+
},
|
|
456
|
+
"name": {
|
|
457
|
+
"char": "n",
|
|
458
|
+
"description": "Name of the event broker service.",
|
|
459
|
+
"name": "name",
|
|
460
|
+
"hasDynamicHelp": false,
|
|
461
|
+
"multiple": false,
|
|
462
|
+
"type": "option"
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
"hasDynamicHelp": false,
|
|
466
|
+
"hiddenAliases": [],
|
|
467
|
+
"id": "missionctrl:broker:state",
|
|
468
|
+
"pluginAlias": "@dishantlangayan/solace-cloud-cli",
|
|
469
|
+
"pluginName": "@dishantlangayan/solace-cloud-cli",
|
|
470
|
+
"pluginType": "core",
|
|
471
|
+
"strict": true,
|
|
472
|
+
"enableJsonFlag": true,
|
|
473
|
+
"isESM": true,
|
|
474
|
+
"relativePath": [
|
|
475
|
+
"dist",
|
|
476
|
+
"commands",
|
|
477
|
+
"missionctrl",
|
|
478
|
+
"broker",
|
|
479
|
+
"state.js"
|
|
480
|
+
]
|
|
481
|
+
},
|
|
415
482
|
"missionctrl:broker:update": {
|
|
416
483
|
"aliases": [],
|
|
417
484
|
"args": {},
|
|
418
485
|
"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
486
|
"examples": [
|
|
420
|
-
"<%= config.bin %> <%= command.id %>"
|
|
487
|
+
"<%= config.bin %> <%= command.id %>",
|
|
488
|
+
"<%= config.bin %> <%= command.id %> --broker-id <broker-id> --new-name <new-name>",
|
|
489
|
+
"<%= config.bin %> <%= command.id %> --name <name> --new-name <new-name>"
|
|
421
490
|
],
|
|
422
491
|
"flags": {
|
|
423
492
|
"json": {
|
|
@@ -497,7 +566,7 @@
|
|
|
497
566
|
"args": {},
|
|
498
567
|
"description": "Create a new environment.\n\n Token Permissions: [ environments:edit ]",
|
|
499
568
|
"examples": [
|
|
500
|
-
"<%= config.bin %> <%= command.id %> --name=MyEnvironment --
|
|
569
|
+
"<%= config.bin %> <%= command.id %> --name=MyEnvironment --description=\"My environment description\" --isDefault --isProduction"
|
|
501
570
|
],
|
|
502
571
|
"flags": {
|
|
503
572
|
"json": {
|
|
@@ -532,13 +601,13 @@
|
|
|
532
601
|
"type": "option"
|
|
533
602
|
},
|
|
534
603
|
"isDefault": {
|
|
535
|
-
"description": "Indicates this is the organization
|
|
604
|
+
"description": "Indicates this is the organization's default environment.",
|
|
536
605
|
"name": "isDefault",
|
|
537
606
|
"allowNo": false,
|
|
538
607
|
"type": "boolean"
|
|
539
608
|
},
|
|
540
609
|
"isProduction": {
|
|
541
|
-
"description": "Indicates this is an organization
|
|
610
|
+
"description": "Indicates this is an organization's production environment. \n This is an immutable field. If an environment needs to be migrated, \n architecture can be migrated to a new environment with the desired \n environment type instead.",
|
|
542
611
|
"name": "isProduction",
|
|
543
612
|
"allowNo": false,
|
|
544
613
|
"type": "boolean"
|
|
@@ -788,8 +857,8 @@
|
|
|
788
857
|
"args": {},
|
|
789
858
|
"description": "Modify an environment's attributes\n \n Use either the Environment's ID (--env-id) or name of the Environment (--name).\n \n Token Permissions: [ environments:edit ]\n ",
|
|
790
859
|
"examples": [
|
|
791
|
-
"<%= config.bin %> <%= command.id %> --name=MyEnvName --new-name=MyNewEnvName --
|
|
792
|
-
"<%= config.bin %> <%= command.id %> --env-id=MyEnvId --new-name=MyNewEnvName --
|
|
860
|
+
"<%= config.bin %> <%= command.id %> --name=MyEnvName --new-name=MyNewEnvName --description=\"My description to update\" --isDefault",
|
|
861
|
+
"<%= config.bin %> <%= command.id %> --env-id=MyEnvId --new-name=MyNewEnvName --description=\"My description to update\" --isDefault"
|
|
793
862
|
],
|
|
794
863
|
"flags": {
|
|
795
864
|
"json": {
|
|
@@ -871,5 +940,5 @@
|
|
|
871
940
|
]
|
|
872
941
|
}
|
|
873
942
|
},
|
|
874
|
-
"version": "0.
|
|
943
|
+
"version": "0.2.0"
|
|
875
944
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dishantlangayan/solace-cloud-cli",
|
|
3
3
|
"description": "The Solace Cloud CLI",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"author": "Dishant Langayan",
|
|
6
6
|
"bin": {
|
|
7
7
|
"sc": "./bin/run.js"
|
|
8
8
|
},
|
|
9
9
|
"bugs": "https://github.com/dishantlangayan/solace-cloud-cli/issues",
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"@dishantlangayan/sc-cli-core": "^0.1.0",
|
|
11
12
|
"@oclif/core": "^4",
|
|
12
13
|
"@oclif/plugin-help": "^6",
|
|
13
14
|
"@oclif/plugin-plugins": "^5",
|
|
@@ -45,7 +46,10 @@
|
|
|
45
46
|
],
|
|
46
47
|
"homepage": "https://github.com/dishantlangayan/solace-cloud-cli",
|
|
47
48
|
"keywords": [
|
|
48
|
-
"oclif"
|
|
49
|
+
"oclif",
|
|
50
|
+
"solace",
|
|
51
|
+
"cli",
|
|
52
|
+
"sc"
|
|
49
53
|
],
|
|
50
54
|
"license": "Apache-2.0",
|
|
51
55
|
"main": "dist/index.js",
|
|
@@ -58,12 +62,7 @@
|
|
|
58
62
|
"@oclif/plugin-help",
|
|
59
63
|
"@oclif/plugin-plugins"
|
|
60
64
|
],
|
|
61
|
-
"topicSeparator": " "
|
|
62
|
-
"topics": {
|
|
63
|
-
"hello": {
|
|
64
|
-
"description": "Say hello to the world and others"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
65
|
+
"topicSeparator": " "
|
|
67
66
|
},
|
|
68
67
|
"repository": "dishantlangayan/solace-cloud-cli",
|
|
69
68
|
"scripts": {
|
package/dist/sc-command.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Command, Interfaces } from '@oclif/core';
|
|
2
|
-
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<T['flags'] & typeof ScCommand['baseFlags']>;
|
|
3
|
-
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
|
|
4
|
-
/**
|
|
5
|
-
* A base command that provided common functionality for all sc commands.
|
|
6
|
-
*
|
|
7
|
-
* All implementations of this class need to implement the run() method.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export declare abstract class ScCommand<T extends typeof Command> extends Command {
|
|
11
|
-
static baseFlags: {
|
|
12
|
-
'log-level': Interfaces.OptionFlag<"error" | "warn" | "debug" | "info" | "trace", Interfaces.CustomOptions>;
|
|
13
|
-
};
|
|
14
|
-
static enableJsonFlag: boolean;
|
|
15
|
-
protected args: Args<T>;
|
|
16
|
-
protected flags: Flags<T>;
|
|
17
|
-
protected catch(err: Error & {
|
|
18
|
-
exitCode?: number;
|
|
19
|
-
}): Promise<unknown>;
|
|
20
|
-
protected finally(_: Error | undefined): Promise<unknown>;
|
|
21
|
-
init(): Promise<void>;
|
|
22
|
-
}
|
package/dist/sc-command.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import { DefaultBaseUrl, EnvironmentVariable, envVars } from './config/env-vars.js';
|
|
3
|
-
/**
|
|
4
|
-
* A base command that provided common functionality for all sc commands.
|
|
5
|
-
*
|
|
6
|
-
* All implementations of this class need to implement the run() method.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export class ScCommand extends Command {
|
|
10
|
-
// define flags that can be inherited by any command that extends BaseCommand
|
|
11
|
-
static baseFlags = {
|
|
12
|
-
'log-level': Flags.option({
|
|
13
|
-
default: 'info',
|
|
14
|
-
helpGroup: 'GLOBAL',
|
|
15
|
-
options: ['debug', 'warn', 'error', 'info', 'trace'],
|
|
16
|
-
summary: 'Specify level for logging.',
|
|
17
|
-
})(),
|
|
18
|
-
};
|
|
19
|
-
// add the --json flag
|
|
20
|
-
static enableJsonFlag = true;
|
|
21
|
-
args;
|
|
22
|
-
flags;
|
|
23
|
-
async catch(err) {
|
|
24
|
-
// add any custom logic to handle errors from the command
|
|
25
|
-
// or simply return the parent class error handling
|
|
26
|
-
return super.catch(err);
|
|
27
|
-
}
|
|
28
|
-
async finally(_) {
|
|
29
|
-
// called after run and catch regardless of whether or not the command errored
|
|
30
|
-
return super.finally(_);
|
|
31
|
-
}
|
|
32
|
-
async init() {
|
|
33
|
-
await super.init();
|
|
34
|
-
const { args, flags } = await this.parse({
|
|
35
|
-
args: this.ctor.args,
|
|
36
|
-
baseFlags: super.ctor.baseFlags,
|
|
37
|
-
enableJsonFlag: this.ctor.enableJsonFlag,
|
|
38
|
-
flags: this.ctor.flags,
|
|
39
|
-
strict: this.ctor.strict,
|
|
40
|
-
});
|
|
41
|
-
this.flags = flags;
|
|
42
|
-
this.args = args;
|
|
43
|
-
// set base url if not defined in environment variables
|
|
44
|
-
if (!envVars.getString(EnvironmentVariable.SC_BASE_URL)) {
|
|
45
|
-
this.debug(`Environment variable '${EnvironmentVariable.SC_BASE_URL}' not set, using default '${DefaultBaseUrl}'`);
|
|
46
|
-
envVars.setString(EnvironmentVariable.SC_BASE_URL, DefaultBaseUrl);
|
|
47
|
-
}
|
|
48
|
-
// Check if Access Token is set
|
|
49
|
-
const value = envVars.getString(EnvironmentVariable.SC_ACCESS_TOKEN);
|
|
50
|
-
if (!value) {
|
|
51
|
-
throw new Error(`Environment variable ${EnvironmentVariable.SC_ACCESS_TOKEN} is not set and required for any API operations.`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
package/dist/util/internal.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Formats a camel case style `string` into a title case.
|
|
3
|
-
*
|
|
4
|
-
* @param text Text to transform.
|
|
5
|
-
*/
|
|
6
|
-
export declare function camelCaseToTitleCase(text: string): string;
|
|
7
|
-
export interface ColumnConfig {
|
|
8
|
-
width?: number;
|
|
9
|
-
wrapWord?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function renderTable<T>(data: T[][], columnConfig?: Record<number, ColumnConfig>): string;
|
|
12
|
-
export declare function renderKeyValueTable<T>(data: T[][], columnConfig?: Record<number, ColumnConfig>): string;
|
|
13
|
-
/**
|
|
14
|
-
* Sleep function.
|
|
15
|
-
* @param ms Num of milliseconds to wait
|
|
16
|
-
* @returns Promise that resolves after the specified time
|
|
17
|
-
*/
|
|
18
|
-
export declare function sleep(ms: number): Promise<void>;
|
|
19
|
-
export declare const sleepModule: {
|
|
20
|
-
sleep: typeof sleep;
|
|
21
|
-
};
|