clever-tools 3.13.1 → 4.0.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 +130 -37
- package/bin/clever.js +1427 -718
- package/package.json +62 -77
- package/src/clever-client/auth-bridge.js +9 -12
- package/src/clever-client/ng.js +1 -1
- package/src/clever-client/operators.js +7 -7
- package/src/command-options.js +6 -6
- package/src/command-promise-handler.js +6 -6
- package/src/commands/accesslogs.js +38 -29
- package/src/commands/activity.js +62 -40
- package/src/commands/addon.js +65 -69
- package/src/commands/applications.js +33 -31
- package/src/commands/cancel-deploy.js +7 -7
- package/src/commands/config.js +9 -7
- package/src/commands/console.js +3 -3
- package/src/commands/create.js +33 -32
- package/src/commands/curl.js +14 -36
- package/src/commands/database.js +10 -30
- package/src/commands/delete.js +8 -8
- package/src/commands/deploy.js +60 -46
- package/src/commands/diag.js +27 -25
- package/src/commands/domain.js +89 -91
- package/src/commands/drain.js +26 -14
- package/src/commands/emails.js +24 -28
- package/src/commands/env.js +18 -18
- package/src/commands/features.js +12 -18
- package/src/commands/keycloak.js +11 -11
- package/src/commands/kv.js +13 -13
- package/src/commands/link.js +9 -8
- package/src/commands/login.js +19 -27
- package/src/commands/logout.js +1 -1
- package/src/commands/logs.js +20 -12
- package/src/commands/makeDefault.js +5 -5
- package/src/commands/matomo.js +7 -7
- package/src/commands/metabase.js +9 -9
- package/src/commands/ng.js +32 -32
- package/src/commands/notify-email.js +11 -15
- package/src/commands/open.js +1 -1
- package/src/commands/otoroshi.js +11 -11
- package/src/commands/profile.js +8 -8
- package/src/commands/published-config.js +11 -11
- package/src/commands/restart.js +15 -8
- package/src/commands/scale.js +25 -16
- package/src/commands/service.js +28 -11
- package/src/commands/ssh-keys.js +25 -29
- package/src/commands/ssh.js +1 -2
- package/src/commands/status.js +31 -22
- package/src/commands/stop.js +3 -3
- package/src/commands/tcp-redirs.js +27 -26
- package/src/commands/tokens.js +44 -43
- package/src/commands/unlink.js +7 -5
- package/src/commands/version.js +2 -4
- package/src/commands/webhooks.js +8 -10
- package/src/experimental-features.js +7 -5
- package/src/format-table.js +46 -15
- package/src/initial-setup.js +2 -32
- package/src/initial-update-notifier.js +18 -0
- package/src/lib/has-param.js +16 -0
- package/src/lib/ng-print.js +21 -24
- package/src/lib/operator-commands.js +58 -53
- package/src/lib/prompts.js +5 -5
- package/src/lib/slugify.js +1 -1
- package/src/logger.js +26 -21
- package/src/models/activity.js +3 -3
- package/src/models/addon.js +54 -56
- package/src/models/app_configuration.js +34 -32
- package/src/models/application.js +90 -77
- package/src/models/application_configuration.js +19 -27
- package/src/models/configuration.js +30 -32
- package/src/models/deployments.js +9 -19
- package/src/models/domain.js +10 -9
- package/src/models/drain.js +16 -15
- package/src/models/exit-strategy-option.js +15 -5
- package/src/models/fs-utils.js +4 -3
- package/src/models/git.js +26 -32
- package/src/models/ids-resolver.js +37 -41
- package/src/models/isomorphic-http-with-agent.js +3 -3
- package/src/models/json-array.js +5 -6
- package/src/models/log-v4.js +44 -52
- package/src/models/log.js +40 -45
- package/src/models/namespaces.js +4 -4
- package/src/models/ng-resources.js +49 -39
- package/src/models/ng.js +41 -40
- package/src/models/node-dns-resolver.js +3 -3
- package/src/models/notification.js +7 -10
- package/src/models/operator.js +8 -10
- package/src/models/organisation.js +5 -8
- package/src/models/send-to-api.js +18 -11
- package/src/models/user.js +6 -5
- package/src/models/utils.js +5 -8
- package/src/models/variables.js +18 -20
- package/src/parsers.js +34 -34
- package/src/load-package-json.cjs +0 -5
package/bin/clever.js
CHANGED
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// WARNING: this needs to run before other imports
|
|
4
4
|
import '../src/initial-setup.js';
|
|
5
|
-
|
|
5
|
+
import '../src/initial-update-notifier.js';
|
|
6
|
+
// Other imports
|
|
6
7
|
import cliparse from 'cliparse';
|
|
7
|
-
import colors from 'colors/safe.js';
|
|
8
8
|
import cliparseCommands from 'cliparse/src/command.js';
|
|
9
9
|
import _sortBy from 'lodash/sortBy.js';
|
|
10
|
-
|
|
11
|
-
import
|
|
12
|
-
import * as git from '../src/models/git.js';
|
|
13
|
-
import * as Parsers from '../src/parsers.js';
|
|
14
|
-
import { handleCommandPromise } from '../src/command-promise-handler.js';
|
|
15
|
-
import * as Application from '../src/models/application.js';
|
|
16
|
-
import { AVAILABLE_ZONES } from '../src/models/application.js';
|
|
17
|
-
import { EXPERIMENTAL_FEATURES } from '../src/experimental-features.js';
|
|
10
|
+
import { styleText } from 'node:util';
|
|
11
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
18
12
|
import { getExitOnOption, getOutputFormatOption, getSameCommitPolicyOption } from '../src/command-options.js';
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
import * as Addon from '../src/models/addon.js';
|
|
22
|
-
import * as ApplicationConfiguration from '../src/models/application_configuration.js';
|
|
23
|
-
import * as Drain from '../src/models/drain.js';
|
|
24
|
-
import * as Notification from '../src/models/notification.js';
|
|
25
|
-
import * as Namespaces from '../src/models/namespaces.js';
|
|
26
|
-
|
|
13
|
+
import { handleCommandPromise } from '../src/command-promise-handler.js';
|
|
27
14
|
import * as accesslogsModule from '../src/commands/accesslogs.js';
|
|
28
15
|
import * as activity from '../src/commands/activity.js';
|
|
29
16
|
import * as addon from '../src/commands/addon.js';
|
|
30
17
|
import * as applications from '../src/commands/applications.js';
|
|
31
18
|
import * as cancelDeploy from '../src/commands/cancel-deploy.js';
|
|
32
19
|
import * as config from '../src/commands/config.js';
|
|
20
|
+
import * as consoleModule from '../src/commands/console.js';
|
|
33
21
|
import * as create from '../src/commands/create.js';
|
|
22
|
+
import { curl } from '../src/commands/curl.js';
|
|
23
|
+
import * as database from '../src/commands/database.js';
|
|
34
24
|
import * as deleteCommandModule from '../src/commands/delete.js';
|
|
35
25
|
import * as deploy from '../src/commands/deploy.js';
|
|
36
26
|
import * as diag from '../src/commands/diag.js';
|
|
@@ -45,21 +35,20 @@ import * as link from '../src/commands/link.js';
|
|
|
45
35
|
import * as login from '../src/commands/login.js';
|
|
46
36
|
import * as logout from '../src/commands/logout.js';
|
|
47
37
|
import * as logs from '../src/commands/logs.js';
|
|
38
|
+
import * as makeDefault from '../src/commands/makeDefault.js';
|
|
48
39
|
import * as matomo from '../src/commands/matomo.js';
|
|
49
40
|
import * as metabase from '../src/commands/metabase.js';
|
|
50
|
-
import * as makeDefault from '../src/commands/makeDefault.js';
|
|
51
41
|
import * as ng from '../src/commands/ng.js';
|
|
52
42
|
import * as notifyEmail from '../src/commands/notify-email.js';
|
|
53
43
|
import * as open from '../src/commands/open.js';
|
|
54
|
-
import * as consoleModule from '../src/commands/console.js';
|
|
55
44
|
import * as otoroshi from '../src/commands/otoroshi.js';
|
|
56
45
|
import * as profile from '../src/commands/profile.js';
|
|
57
46
|
import * as publishedConfig from '../src/commands/published-config.js';
|
|
58
47
|
import * as restart from '../src/commands/restart.js';
|
|
59
48
|
import * as scale from '../src/commands/scale.js';
|
|
60
49
|
import * as service from '../src/commands/service.js';
|
|
61
|
-
import * as ssh from '../src/commands/ssh.js';
|
|
62
50
|
import * as sshKeys from '../src/commands/ssh-keys.js';
|
|
51
|
+
import * as ssh from '../src/commands/ssh.js';
|
|
63
52
|
import * as status from '../src/commands/status.js';
|
|
64
53
|
import * as stop from '../src/commands/stop.js';
|
|
65
54
|
import * as tcpRedirs from '../src/commands/tcp-redirs.js';
|
|
@@ -67,8 +56,17 @@ import * as tokens from '../src/commands/tokens.js';
|
|
|
67
56
|
import * as unlink from '../src/commands/unlink.js';
|
|
68
57
|
import * as version from '../src/commands/version.js';
|
|
69
58
|
import * as webhooks from '../src/commands/webhooks.js';
|
|
70
|
-
import
|
|
71
|
-
import
|
|
59
|
+
import { EXPERIMENTAL_FEATURES } from '../src/experimental-features.js';
|
|
60
|
+
import * as Addon from '../src/models/addon.js';
|
|
61
|
+
import * as Application from '../src/models/application.js';
|
|
62
|
+
import { AVAILABLE_ZONES } from '../src/models/application.js';
|
|
63
|
+
import * as ApplicationConfiguration from '../src/models/application_configuration.js';
|
|
64
|
+
import { conf, getFeatures } from '../src/models/configuration.js';
|
|
65
|
+
import * as Drain from '../src/models/drain.js';
|
|
66
|
+
import * as git from '../src/models/git.js';
|
|
67
|
+
import * as Namespaces from '../src/models/namespaces.js';
|
|
68
|
+
import * as Notification from '../src/models/notification.js';
|
|
69
|
+
import * as Parsers from '../src/parsers.js';
|
|
72
70
|
|
|
73
71
|
// Exit cleanly if the program we pipe to exits abruptly
|
|
74
72
|
process.stdout.on('error', (error) => {
|
|
@@ -88,17 +86,18 @@ cliparse.command = function (name, options, commandFunction) {
|
|
|
88
86
|
};
|
|
89
87
|
|
|
90
88
|
// Add a yellow color and status tag to the description of an experimental command
|
|
91
|
-
function colorizeExperimentalCommand
|
|
89
|
+
function colorizeExperimentalCommand(command, id) {
|
|
92
90
|
const status = EXPERIMENTAL_FEATURES[id].status;
|
|
93
|
-
command.description =
|
|
91
|
+
command.description = styleText('yellow', command.description + ' [' + status.toUpperCase() + ']');
|
|
94
92
|
return command;
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
async function run
|
|
98
|
-
|
|
95
|
+
async function run() {
|
|
99
96
|
// ARGUMENTS
|
|
100
97
|
const args = {
|
|
101
|
-
kvRawCommand: cliparse.argument('command', {
|
|
98
|
+
kvRawCommand: cliparse.argument('command', {
|
|
99
|
+
description: 'The raw command to send to the Materia KV or Redis® add-on',
|
|
100
|
+
}),
|
|
102
101
|
kvIdOrName: cliparse.argument('kv-id', {
|
|
103
102
|
description: 'Add-on/Real ID (or name, if unambiguous) of a Materia KV or Redis® add-on',
|
|
104
103
|
}),
|
|
@@ -157,7 +156,9 @@ async function run () {
|
|
|
157
156
|
default: '',
|
|
158
157
|
}),
|
|
159
158
|
backupId: cliparse.argument('backup-id', { description: 'A Database backup ID (format: UUID)' }),
|
|
160
|
-
databaseId: cliparse.argument('database-id', {
|
|
159
|
+
databaseId: cliparse.argument('database-id', {
|
|
160
|
+
description: 'Any database ID (format: addon_UUID, postgresql_UUID, mysql_UUID, ...)',
|
|
161
|
+
}),
|
|
161
162
|
drainId: cliparse.argument('drain-id', { description: 'Drain ID' }),
|
|
162
163
|
drainType: cliparse.argument('drain-type', {
|
|
163
164
|
description: 'Drain type',
|
|
@@ -185,7 +186,7 @@ async function run () {
|
|
|
185
186
|
}),
|
|
186
187
|
configurationName: cliparse.argument('configuration-name', {
|
|
187
188
|
description: `Configuration to manage: ${ApplicationConfiguration.listAvailableIds(true)}`,
|
|
188
|
-
complete
|
|
189
|
+
complete() {
|
|
189
190
|
return cliparse.autocomplete.words(ApplicationConfiguration.listAvailableIds());
|
|
190
191
|
},
|
|
191
192
|
}),
|
|
@@ -211,7 +212,8 @@ async function run () {
|
|
|
211
212
|
}),
|
|
212
213
|
ngMembersIdsToLink: cliparse.option('link', {
|
|
213
214
|
metavar: 'members_ids',
|
|
214
|
-
description:
|
|
215
|
+
description:
|
|
216
|
+
"Comma separated list of members IDs to link to a Network Group ('app_xxx', 'addon_xxx', 'external_xxx')",
|
|
215
217
|
parser: Parsers.commaSeparated,
|
|
216
218
|
}),
|
|
217
219
|
ngMemberLabel: cliparse.option('label', {
|
|
@@ -278,7 +280,7 @@ async function run () {
|
|
|
278
280
|
default: '',
|
|
279
281
|
metavar: 'branch',
|
|
280
282
|
description: 'Branch to push (current branch by default)',
|
|
281
|
-
complete
|
|
283
|
+
complete() {
|
|
282
284
|
return git.completeBranches();
|
|
283
285
|
},
|
|
284
286
|
}),
|
|
@@ -316,7 +318,7 @@ async function run () {
|
|
|
316
318
|
metavar: 'flavor',
|
|
317
319
|
parser: Parsers.flavor,
|
|
318
320
|
description: 'The instance size of your application',
|
|
319
|
-
complete
|
|
321
|
+
complete() {
|
|
320
322
|
return cliparse.autocomplete.words(Application.listAvailableFlavors());
|
|
321
323
|
},
|
|
322
324
|
}),
|
|
@@ -326,14 +328,14 @@ async function run () {
|
|
|
326
328
|
}),
|
|
327
329
|
forceDeploy: cliparse.flag('force', {
|
|
328
330
|
aliases: ['f'],
|
|
329
|
-
description:
|
|
331
|
+
description: "Force deploy even if it's not fast-forwardable",
|
|
330
332
|
}),
|
|
331
333
|
exitOnDeploy: getExitOnOption(),
|
|
332
334
|
sameCommitPolicy: getSameCommitPolicyOption(),
|
|
333
335
|
webhookFormat: cliparse.option('format', {
|
|
334
336
|
metavar: 'format',
|
|
335
337
|
default: 'raw',
|
|
336
|
-
description:
|
|
338
|
+
description: "Format of the body sent to the webhook ('raw', 'slack', 'gitter', or 'flowdock')",
|
|
337
339
|
}),
|
|
338
340
|
github: cliparse.option('github', {
|
|
339
341
|
metavar: 'OWNER/REPO',
|
|
@@ -355,19 +357,21 @@ async function run () {
|
|
|
355
357
|
description: 'Link the created add-on to the app with the specified alias',
|
|
356
358
|
complete: Application.listAvailableAliases,
|
|
357
359
|
}),
|
|
358
|
-
listAllNotifications: cliparse.flag('list-all', {
|
|
360
|
+
listAllNotifications: cliparse.flag('list-all', {
|
|
361
|
+
description: "List all notifications for your user or for an organisation with the '--org' option",
|
|
362
|
+
}),
|
|
359
363
|
maxFlavor: cliparse.option('max-flavor', {
|
|
360
364
|
metavar: 'maxflavor',
|
|
361
365
|
parser: Parsers.flavor,
|
|
362
366
|
description: 'The maximum instance size of your application',
|
|
363
|
-
complete
|
|
367
|
+
complete() {
|
|
364
368
|
return cliparse.autocomplete.words(Application.listAvailableFlavors());
|
|
365
369
|
},
|
|
366
370
|
}),
|
|
367
371
|
buildFlavor: cliparse.option('build-flavor', {
|
|
368
372
|
metavar: 'buildflavor',
|
|
369
373
|
parser: Parsers.buildFlavor,
|
|
370
|
-
description:
|
|
374
|
+
description: "The size of the build instance, or 'disabled' if you want to disable dedicated build instances",
|
|
371
375
|
}),
|
|
372
376
|
maxInstances: cliparse.option('max-instances', {
|
|
373
377
|
metavar: 'maxinstances',
|
|
@@ -378,7 +382,7 @@ async function run () {
|
|
|
378
382
|
metavar: 'minflavor',
|
|
379
383
|
parser: Parsers.flavor,
|
|
380
384
|
description: 'The minimum scale size of your application',
|
|
381
|
-
complete
|
|
385
|
+
complete() {
|
|
382
386
|
return cliparse.autocomplete.words(Application.listAvailableFlavors());
|
|
383
387
|
},
|
|
384
388
|
}),
|
|
@@ -393,7 +397,8 @@ async function run () {
|
|
|
393
397
|
}),
|
|
394
398
|
emailNotificationTarget: cliparse.option('notify', {
|
|
395
399
|
metavar: '<email_address>|<user_id>|"organisation"',
|
|
396
|
-
description:
|
|
400
|
+
description:
|
|
401
|
+
'Notify a user, a specific email address or the whole organisation (multiple values allowed, comma separated)',
|
|
397
402
|
required: true,
|
|
398
403
|
parser: Parsers.commaSeparated,
|
|
399
404
|
}),
|
|
@@ -427,7 +432,7 @@ async function run () {
|
|
|
427
432
|
description: 'Add-on plan, depends on the provider',
|
|
428
433
|
complete: Addon.completePlan,
|
|
429
434
|
}),
|
|
430
|
-
quiet: cliparse.flag('quiet', { aliases: ['q'], description:
|
|
435
|
+
quiet: cliparse.flag('quiet', { aliases: ['q'], description: "Don't show logs during deployment" }),
|
|
431
436
|
followDeployLogs: cliparse.flag('follow', {
|
|
432
437
|
description: 'Continue to follow logs after deployment has ended',
|
|
433
438
|
}),
|
|
@@ -445,7 +450,8 @@ async function run () {
|
|
|
445
450
|
addonOptions: cliparse.option('option', {
|
|
446
451
|
metavar: 'option',
|
|
447
452
|
parser: Parsers.addonOptions,
|
|
448
|
-
description:
|
|
453
|
+
description:
|
|
454
|
+
'Option to enable for the add-on. Multiple --option argument can be passed to enable multiple options',
|
|
449
455
|
}),
|
|
450
456
|
region: cliparse.option('region', {
|
|
451
457
|
aliases: ['r'],
|
|
@@ -570,766 +576,1470 @@ async function run () {
|
|
|
570
576
|
};
|
|
571
577
|
|
|
572
578
|
// ACCESSLOGS COMMAND
|
|
573
|
-
const accesslogsCommand = cliparse.command(
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
579
|
+
const accesslogsCommand = cliparse.command(
|
|
580
|
+
'accesslogs',
|
|
581
|
+
{
|
|
582
|
+
description: 'Fetch access logs',
|
|
583
|
+
options: [opts.alias, opts.appIdOrName, opts.logsFormat, opts.before, opts.after, opts.addonId],
|
|
584
|
+
},
|
|
585
|
+
accesslogsModule.accessLogs,
|
|
586
|
+
);
|
|
577
587
|
|
|
578
588
|
// ACTIVITY COMMAND
|
|
579
|
-
const activityCommand = cliparse.command(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
589
|
+
const activityCommand = cliparse.command(
|
|
590
|
+
'activity',
|
|
591
|
+
{
|
|
592
|
+
description: 'Show last deployments of an application',
|
|
593
|
+
options: [opts.alias, opts.appIdOrName, opts.follow, opts.showAllActivity, opts.activityFormat],
|
|
594
|
+
},
|
|
595
|
+
activity.activity,
|
|
596
|
+
);
|
|
583
597
|
|
|
584
598
|
// ADDON COMMANDS
|
|
585
|
-
const addonCreateCommand = cliparse.command(
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
599
|
+
const addonCreateCommand = cliparse.command(
|
|
600
|
+
'create',
|
|
601
|
+
{
|
|
602
|
+
description: 'Create an add-on',
|
|
603
|
+
args: [args.addonProvider, args.addonName],
|
|
604
|
+
options: [
|
|
605
|
+
opts.linkAddon,
|
|
606
|
+
opts.confirmAddonCreation,
|
|
607
|
+
opts.addonPlan,
|
|
608
|
+
opts.addonRegion,
|
|
609
|
+
opts.addonVersion,
|
|
610
|
+
opts.addonOptions,
|
|
611
|
+
opts.humanJsonOutputFormat,
|
|
612
|
+
],
|
|
613
|
+
},
|
|
614
|
+
addon.create,
|
|
615
|
+
);
|
|
616
|
+
const addonDeleteCommand = cliparse.command(
|
|
617
|
+
'delete',
|
|
618
|
+
{
|
|
619
|
+
description: 'Delete an add-on',
|
|
620
|
+
args: [args.addonIdOrName],
|
|
621
|
+
options: [opts.confirmAddonDeletion],
|
|
622
|
+
},
|
|
623
|
+
addon.deleteAddon,
|
|
624
|
+
);
|
|
625
|
+
const addonRenameCommand = cliparse.command(
|
|
626
|
+
'rename',
|
|
627
|
+
{
|
|
628
|
+
description: 'Rename an add-on',
|
|
629
|
+
args: [args.addonIdOrName, args.addonName],
|
|
630
|
+
},
|
|
631
|
+
addon.rename,
|
|
632
|
+
);
|
|
633
|
+
const addonShowProviderCommand = cliparse.command(
|
|
634
|
+
'show',
|
|
635
|
+
{
|
|
636
|
+
description: 'Show information about an add-on provider',
|
|
637
|
+
args: [args.addonProvider],
|
|
638
|
+
},
|
|
639
|
+
addon.showProvider,
|
|
640
|
+
);
|
|
641
|
+
const addonProvidersCommand = cliparse.command(
|
|
642
|
+
'providers',
|
|
643
|
+
{
|
|
644
|
+
description: 'List available add-on providers',
|
|
645
|
+
commands: [addonShowProviderCommand],
|
|
646
|
+
options: [opts.humanJsonOutputFormat],
|
|
647
|
+
},
|
|
648
|
+
addon.listProviders,
|
|
649
|
+
);
|
|
650
|
+
const addonEnvCommand = cliparse.command(
|
|
651
|
+
'env',
|
|
652
|
+
{
|
|
653
|
+
description: 'List environment variables for an add-on',
|
|
654
|
+
options: [opts.envFormat],
|
|
655
|
+
args: [opts.addonId],
|
|
656
|
+
},
|
|
657
|
+
addon.env,
|
|
658
|
+
);
|
|
659
|
+
const addonListCommand = cliparse.command(
|
|
660
|
+
'list',
|
|
661
|
+
{
|
|
662
|
+
description: 'List available add-ons',
|
|
663
|
+
options: [opts.humanJsonOutputFormat],
|
|
664
|
+
},
|
|
665
|
+
addon.list,
|
|
666
|
+
);
|
|
667
|
+
|
|
668
|
+
const addonCommands = cliparse.command(
|
|
669
|
+
'addon',
|
|
670
|
+
{
|
|
671
|
+
description: 'Manage add-ons',
|
|
672
|
+
options: [opts.orgaIdOrName],
|
|
673
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
674
|
+
commands: [
|
|
675
|
+
addonCreateCommand,
|
|
676
|
+
addonDeleteCommand,
|
|
677
|
+
addonRenameCommand,
|
|
678
|
+
addonListCommand,
|
|
679
|
+
addonProvidersCommand,
|
|
680
|
+
addonEnvCommand,
|
|
681
|
+
],
|
|
682
|
+
},
|
|
683
|
+
addon.list,
|
|
684
|
+
);
|
|
624
685
|
|
|
625
686
|
// APPLICATIONS COMMAND
|
|
626
|
-
const applicationsListRemoteCommand = cliparse.command(
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
687
|
+
const applicationsListRemoteCommand = cliparse.command(
|
|
688
|
+
'list',
|
|
689
|
+
{
|
|
690
|
+
description: 'List all applications',
|
|
691
|
+
options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
|
|
692
|
+
},
|
|
693
|
+
applications.listAll,
|
|
694
|
+
);
|
|
695
|
+
const applicationsCommand = cliparse.command(
|
|
696
|
+
'applications',
|
|
697
|
+
{
|
|
698
|
+
description: 'List linked applications',
|
|
699
|
+
privateOptions: [opts.onlyAliases, opts.jsonFormat],
|
|
700
|
+
commands: [applicationsListRemoteCommand],
|
|
701
|
+
},
|
|
702
|
+
applications.list,
|
|
703
|
+
);
|
|
635
704
|
|
|
636
705
|
// CANCEL DEPLOY COMMAND
|
|
637
|
-
const cancelDeployCommand = cliparse.command(
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
706
|
+
const cancelDeployCommand = cliparse.command(
|
|
707
|
+
'cancel-deploy',
|
|
708
|
+
{
|
|
709
|
+
description: 'Cancel an ongoing deployment',
|
|
710
|
+
options: [opts.alias, opts.appIdOrName],
|
|
711
|
+
},
|
|
712
|
+
cancelDeploy.cancelDeploy,
|
|
713
|
+
);
|
|
641
714
|
|
|
642
715
|
// CONFIG COMMAND
|
|
643
|
-
const configGetCommand = cliparse.command(
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
716
|
+
const configGetCommand = cliparse.command(
|
|
717
|
+
'get',
|
|
718
|
+
{
|
|
719
|
+
description: 'Display the current configuration',
|
|
720
|
+
args: [args.configurationName],
|
|
721
|
+
},
|
|
722
|
+
config.get,
|
|
723
|
+
);
|
|
724
|
+
const configSetCommand = cliparse.command(
|
|
725
|
+
'set',
|
|
726
|
+
{
|
|
727
|
+
description: 'Edit one configuration setting',
|
|
728
|
+
args: [args.configurationName, args.configurationValue],
|
|
729
|
+
},
|
|
730
|
+
config.set,
|
|
731
|
+
);
|
|
732
|
+
const configUpdateCommand = cliparse.command(
|
|
733
|
+
'update',
|
|
734
|
+
{
|
|
735
|
+
description: 'Edit multiple configuration settings at once',
|
|
736
|
+
options: ApplicationConfiguration.getUpdateOptions(),
|
|
737
|
+
},
|
|
738
|
+
config.update,
|
|
739
|
+
);
|
|
740
|
+
const configCommands = cliparse.command(
|
|
741
|
+
'config',
|
|
742
|
+
{
|
|
743
|
+
description: 'Display or edit the configuration of your application',
|
|
744
|
+
options: [opts.alias, opts.appIdOrName],
|
|
745
|
+
commands: [configGetCommand, configSetCommand, configUpdateCommand],
|
|
746
|
+
},
|
|
747
|
+
config.list,
|
|
748
|
+
);
|
|
660
749
|
|
|
661
750
|
// CREATE COMMAND
|
|
662
|
-
const appCreateCommand = cliparse.command(
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
751
|
+
const appCreateCommand = cliparse.command(
|
|
752
|
+
'create',
|
|
753
|
+
{
|
|
754
|
+
description: 'Create an application',
|
|
755
|
+
args: [args.appNameCreation],
|
|
756
|
+
options: [
|
|
757
|
+
opts.instanceType,
|
|
758
|
+
opts.orgaIdOrName,
|
|
759
|
+
opts.aliasCreation,
|
|
760
|
+
opts.region,
|
|
761
|
+
opts.github,
|
|
762
|
+
opts.taskCommand,
|
|
763
|
+
opts.humanJsonOutputFormat,
|
|
764
|
+
],
|
|
765
|
+
},
|
|
766
|
+
create.create,
|
|
767
|
+
);
|
|
667
768
|
|
|
668
769
|
// CURL COMMAND
|
|
669
770
|
// NOTE: it's just here for documentation purposes, look at the bottom of the file for the real "clever curl" command
|
|
670
|
-
const curlCommand = cliparse.command(
|
|
671
|
-
|
|
672
|
-
|
|
771
|
+
const curlCommand = cliparse.command(
|
|
772
|
+
'curl',
|
|
773
|
+
{
|
|
774
|
+
description: "Query Clever Cloud's API using Clever Tools credentials",
|
|
775
|
+
},
|
|
776
|
+
() => null,
|
|
777
|
+
);
|
|
673
778
|
|
|
674
779
|
// DELETE COMMAND
|
|
675
|
-
const deleteCommand = cliparse.command(
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
780
|
+
const deleteCommand = cliparse.command(
|
|
781
|
+
'delete',
|
|
782
|
+
{
|
|
783
|
+
description: 'Delete an application',
|
|
784
|
+
options: [opts.alias, opts.appIdOrName, opts.confirmApplicationDeletion],
|
|
785
|
+
},
|
|
786
|
+
deleteCommandModule.deleteApp,
|
|
787
|
+
);
|
|
679
788
|
|
|
680
789
|
// DEPLOY COMMAND
|
|
681
|
-
const deployCommand = cliparse.command(
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
790
|
+
const deployCommand = cliparse.command(
|
|
791
|
+
'deploy',
|
|
792
|
+
{
|
|
793
|
+
description: 'Deploy an application',
|
|
794
|
+
options: [
|
|
795
|
+
opts.alias,
|
|
796
|
+
opts.branch,
|
|
797
|
+
opts.gitTag,
|
|
798
|
+
opts.quiet,
|
|
799
|
+
opts.forceDeploy,
|
|
800
|
+
opts.followDeployLogs,
|
|
801
|
+
opts.sameCommitPolicy,
|
|
802
|
+
opts.exitOnDeploy,
|
|
803
|
+
],
|
|
804
|
+
},
|
|
805
|
+
deploy.deploy,
|
|
806
|
+
);
|
|
685
807
|
|
|
686
808
|
// DIAG COMMAND
|
|
687
|
-
const diagCommand = cliparse.command(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
809
|
+
const diagCommand = cliparse.command(
|
|
810
|
+
'diag',
|
|
811
|
+
{
|
|
812
|
+
description: 'Diagnose the current installation (prints various informations for support)',
|
|
813
|
+
args: [],
|
|
814
|
+
options: [opts.humanJsonOutputFormat],
|
|
815
|
+
},
|
|
816
|
+
diag.diag,
|
|
817
|
+
);
|
|
692
818
|
|
|
693
819
|
// DOMAIN COMMANDS
|
|
694
|
-
const domainCreateCommand = cliparse.command(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
820
|
+
const domainCreateCommand = cliparse.command(
|
|
821
|
+
'add',
|
|
822
|
+
{
|
|
823
|
+
description: 'Add a domain name to an application',
|
|
824
|
+
args: [args.fqdn],
|
|
825
|
+
options: [opts.alias, opts.appIdOrName],
|
|
826
|
+
},
|
|
827
|
+
domain.add,
|
|
828
|
+
);
|
|
829
|
+
const domainRemoveCommand = cliparse.command(
|
|
830
|
+
'rm',
|
|
831
|
+
{
|
|
832
|
+
description: 'Remove a domain name from an application',
|
|
833
|
+
args: [args.fqdn],
|
|
834
|
+
options: [opts.alias, opts.appIdOrName],
|
|
835
|
+
},
|
|
836
|
+
domain.rm,
|
|
837
|
+
);
|
|
838
|
+
const domainSetFavouriteCommand = cliparse.command(
|
|
839
|
+
'set',
|
|
840
|
+
{
|
|
841
|
+
description: 'Set the favourite domain for an application',
|
|
842
|
+
args: [args.fqdn],
|
|
843
|
+
},
|
|
844
|
+
domain.setFavourite,
|
|
845
|
+
);
|
|
846
|
+
const domainUnsetFavouriteCommand = cliparse.command(
|
|
847
|
+
'unset',
|
|
848
|
+
{
|
|
849
|
+
description: 'Unset the favourite domain for an application',
|
|
850
|
+
},
|
|
851
|
+
domain.unsetFavourite,
|
|
852
|
+
);
|
|
853
|
+
const domainFavouriteCommands = cliparse.command(
|
|
854
|
+
'favourite',
|
|
855
|
+
{
|
|
856
|
+
description: 'Manage the favourite domain name for an application',
|
|
857
|
+
options: [opts.alias, opts.appIdOrName],
|
|
858
|
+
commands: [domainSetFavouriteCommand, domainUnsetFavouriteCommand],
|
|
859
|
+
},
|
|
860
|
+
domain.getFavourite,
|
|
861
|
+
);
|
|
862
|
+
const domainDiagApplicationCommand = cliparse.command(
|
|
863
|
+
'diag',
|
|
864
|
+
{
|
|
865
|
+
description: 'Check if domains associated to a specific app are properly configured',
|
|
866
|
+
options: [opts.alias, opts.appIdOrName, opts.humanJsonOutputFormat, opts.domain],
|
|
867
|
+
},
|
|
868
|
+
domain.diagApplication,
|
|
869
|
+
);
|
|
870
|
+
const domainOverviewCommand = cliparse.command(
|
|
871
|
+
'overview',
|
|
872
|
+
{
|
|
873
|
+
description: 'Get an overview of all your domains (all orgas, all apps)',
|
|
874
|
+
options: [opts.humanJsonOutputFormat, opts.domainOverviewFilter],
|
|
875
|
+
},
|
|
876
|
+
domain.overview,
|
|
877
|
+
);
|
|
878
|
+
const domainCommands = cliparse.command(
|
|
879
|
+
'domain',
|
|
880
|
+
{
|
|
881
|
+
description: 'Manage domain names for an application',
|
|
882
|
+
privateOptions: [opts.alias, opts.appIdOrName],
|
|
883
|
+
commands: [
|
|
884
|
+
domainCreateCommand,
|
|
885
|
+
domainFavouriteCommands,
|
|
886
|
+
domainRemoveCommand,
|
|
887
|
+
domainDiagApplicationCommand,
|
|
888
|
+
domainOverviewCommand,
|
|
889
|
+
],
|
|
890
|
+
},
|
|
891
|
+
domain.list,
|
|
892
|
+
);
|
|
729
893
|
|
|
730
894
|
// DRAIN COMMANDS
|
|
731
|
-
const drainCreateCommand = cliparse.command(
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
895
|
+
const drainCreateCommand = cliparse.command(
|
|
896
|
+
'create',
|
|
897
|
+
{
|
|
898
|
+
description: 'Create a drain',
|
|
899
|
+
args: [args.drainType, args.drainUrl],
|
|
900
|
+
options: [
|
|
901
|
+
opts.drainUsername,
|
|
902
|
+
opts.drainPassword,
|
|
903
|
+
opts.drainAPIKey,
|
|
904
|
+
opts.drainIndexPrefix,
|
|
905
|
+
opts.drainSDParameters,
|
|
906
|
+
],
|
|
907
|
+
},
|
|
908
|
+
drain.create,
|
|
909
|
+
);
|
|
910
|
+
const drainRemoveCommand = cliparse.command(
|
|
911
|
+
'remove',
|
|
912
|
+
{
|
|
913
|
+
description: 'Remove a drain',
|
|
914
|
+
args: [args.drainId],
|
|
915
|
+
},
|
|
916
|
+
drain.rm,
|
|
917
|
+
);
|
|
918
|
+
const drainEnableCommand = cliparse.command(
|
|
919
|
+
'enable',
|
|
920
|
+
{
|
|
921
|
+
description: 'Enable a drain',
|
|
922
|
+
args: [args.drainId],
|
|
923
|
+
},
|
|
924
|
+
drain.enable,
|
|
925
|
+
);
|
|
926
|
+
const drainDisableCommand = cliparse.command(
|
|
927
|
+
'disable',
|
|
928
|
+
{
|
|
929
|
+
description: 'Disable a drain',
|
|
930
|
+
args: [args.drainId],
|
|
931
|
+
},
|
|
932
|
+
drain.disable,
|
|
933
|
+
);
|
|
934
|
+
const drainCommands = cliparse.command(
|
|
935
|
+
'drain',
|
|
936
|
+
{
|
|
937
|
+
description: 'Manage drains',
|
|
938
|
+
options: [opts.alias, opts.appIdOrName, opts.addonId],
|
|
939
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
940
|
+
commands: [drainCreateCommand, drainRemoveCommand, drainEnableCommand, drainDisableCommand],
|
|
941
|
+
},
|
|
942
|
+
drain.list,
|
|
943
|
+
);
|
|
754
944
|
|
|
755
945
|
// EMAILS COMMANDS
|
|
756
|
-
const emailsAddCommand = cliparse.command(
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
946
|
+
const emailsAddCommand = cliparse.command(
|
|
947
|
+
'add',
|
|
948
|
+
{
|
|
949
|
+
description: 'Add a new secondary email address to the current user',
|
|
950
|
+
args: [args.email],
|
|
951
|
+
},
|
|
952
|
+
emails.addSecondary,
|
|
953
|
+
);
|
|
954
|
+
const emailsPrimaryCommand = cliparse.command(
|
|
955
|
+
'primary',
|
|
956
|
+
{
|
|
957
|
+
description: 'Set the primary email address of the current user',
|
|
958
|
+
args: [args.email],
|
|
959
|
+
},
|
|
960
|
+
emails.setPrimary,
|
|
961
|
+
);
|
|
962
|
+
const emailsRemoveCommand = cliparse.command(
|
|
963
|
+
'remove',
|
|
964
|
+
{
|
|
965
|
+
description: 'Remove a secondary email address from the current user',
|
|
966
|
+
args: [args.email],
|
|
967
|
+
},
|
|
968
|
+
emails.removeSecondary,
|
|
969
|
+
);
|
|
970
|
+
const emailsClearCommand = cliparse.command(
|
|
971
|
+
'remove-all',
|
|
972
|
+
{
|
|
973
|
+
description: 'Remove all secondary email addresses from the current user',
|
|
974
|
+
options: [opts.yes],
|
|
975
|
+
},
|
|
976
|
+
emails.removeAllSecondary,
|
|
977
|
+
);
|
|
978
|
+
const emailsOpenConsoleCommand = cliparse.command(
|
|
979
|
+
'open',
|
|
980
|
+
{
|
|
981
|
+
description: 'Open the email addresses management page in the Console',
|
|
982
|
+
},
|
|
983
|
+
emails.openConsole,
|
|
984
|
+
);
|
|
985
|
+
const emailsCommands = cliparse.command(
|
|
986
|
+
'emails',
|
|
987
|
+
{
|
|
988
|
+
description: 'Manage email addresses of the current user',
|
|
989
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
990
|
+
commands: [
|
|
991
|
+
emailsAddCommand,
|
|
992
|
+
emailsPrimaryCommand,
|
|
993
|
+
emailsRemoveCommand,
|
|
994
|
+
emailsClearCommand,
|
|
995
|
+
emailsOpenConsoleCommand,
|
|
996
|
+
],
|
|
997
|
+
},
|
|
998
|
+
emails.list,
|
|
999
|
+
);
|
|
780
1000
|
|
|
781
1001
|
// ENV COMMANDS
|
|
782
|
-
const envSetCommand = cliparse.command(
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
1002
|
+
const envSetCommand = cliparse.command(
|
|
1003
|
+
'set',
|
|
1004
|
+
{
|
|
1005
|
+
description: 'Add or update an environment variable named <variable-name> with the value <variable-value>',
|
|
1006
|
+
args: [args.envVariableName, args.envVariableValue],
|
|
1007
|
+
},
|
|
1008
|
+
env.set,
|
|
1009
|
+
);
|
|
1010
|
+
const envRemoveCommand = cliparse.command(
|
|
1011
|
+
'rm',
|
|
1012
|
+
{
|
|
1013
|
+
description: 'Remove an environment variable from an application',
|
|
1014
|
+
args: [args.envVariableName],
|
|
1015
|
+
},
|
|
1016
|
+
env.rm,
|
|
1017
|
+
);
|
|
1018
|
+
const envImportCommand = cliparse.command(
|
|
1019
|
+
'import',
|
|
1020
|
+
{
|
|
1021
|
+
description:
|
|
1022
|
+
'Load environment variables from STDIN\n(WARNING: this deletes all current variables and replace them with the new list loaded from STDIN)',
|
|
1023
|
+
options: [opts.importAsJson],
|
|
1024
|
+
},
|
|
1025
|
+
env.importEnv,
|
|
1026
|
+
);
|
|
1027
|
+
const envImportVarsFromLocalEnvCommand = cliparse.command(
|
|
1028
|
+
'import-vars',
|
|
1029
|
+
{
|
|
1030
|
+
description:
|
|
1031
|
+
'Add or update environment variables named <variable-names> (comma-separated), taking their values from the current environment',
|
|
1032
|
+
args: [args.envVariableNames],
|
|
1033
|
+
},
|
|
1034
|
+
env.importVarsFromLocalEnv,
|
|
1035
|
+
);
|
|
1036
|
+
const envCommands = cliparse.command(
|
|
1037
|
+
'env',
|
|
1038
|
+
{
|
|
1039
|
+
description: 'Manage environment variables of an application',
|
|
1040
|
+
options: [opts.alias, opts.appIdOrName, opts.sourceableEnvVarsList],
|
|
1041
|
+
privateOptions: [opts.envFormat],
|
|
1042
|
+
commands: [envSetCommand, envRemoveCommand, envImportCommand, envImportVarsFromLocalEnvCommand],
|
|
1043
|
+
},
|
|
1044
|
+
env.list,
|
|
1045
|
+
);
|
|
804
1046
|
|
|
805
1047
|
// EXPERIMENTAL FEATURES COMMAND
|
|
806
|
-
const listFeaturesCommand = cliparse.command(
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
1048
|
+
const listFeaturesCommand = cliparse.command(
|
|
1049
|
+
'list',
|
|
1050
|
+
{
|
|
1051
|
+
description: 'List available experimental features',
|
|
1052
|
+
options: [opts.humanJsonOutputFormat],
|
|
1053
|
+
},
|
|
1054
|
+
features.list,
|
|
1055
|
+
);
|
|
1056
|
+
const infoFeaturesCommand = cliparse.command(
|
|
1057
|
+
'info',
|
|
1058
|
+
{
|
|
1059
|
+
description: 'Display info about an experimental feature',
|
|
1060
|
+
args: [args.featureId],
|
|
1061
|
+
},
|
|
1062
|
+
features.info,
|
|
1063
|
+
);
|
|
1064
|
+
const enableFeatureCommand = cliparse.command(
|
|
1065
|
+
'enable',
|
|
1066
|
+
{
|
|
1067
|
+
description: 'Enable experimental features',
|
|
1068
|
+
args: [args.features],
|
|
1069
|
+
},
|
|
1070
|
+
features.enable,
|
|
1071
|
+
);
|
|
1072
|
+
const disableFeatureCommand = cliparse.command(
|
|
1073
|
+
'disable',
|
|
1074
|
+
{
|
|
1075
|
+
description: 'Disable experimental features',
|
|
1076
|
+
args: [args.features],
|
|
1077
|
+
},
|
|
1078
|
+
features.disable,
|
|
1079
|
+
);
|
|
1080
|
+
const featuresCommands = cliparse.command(
|
|
1081
|
+
'features',
|
|
1082
|
+
{
|
|
1083
|
+
description: 'Manage Clever Tools experimental features',
|
|
1084
|
+
commands: [enableFeatureCommand, disableFeatureCommand, listFeaturesCommand, infoFeaturesCommand],
|
|
1085
|
+
},
|
|
1086
|
+
features.list,
|
|
1087
|
+
);
|
|
826
1088
|
|
|
827
1089
|
// KEYCLOAK COMMAND
|
|
828
|
-
const keycloakGetCommand = cliparse.command(
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
const
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1090
|
+
const keycloakGetCommand = cliparse.command(
|
|
1091
|
+
'get',
|
|
1092
|
+
{
|
|
1093
|
+
description: 'Get information about a deployed Keycloak',
|
|
1094
|
+
args: [args.addonIdOrName],
|
|
1095
|
+
options: [opts.humanJsonOutputFormat],
|
|
1096
|
+
},
|
|
1097
|
+
keycloak.get,
|
|
1098
|
+
);
|
|
1099
|
+
const keycloakEnableNgCommand = cliparse.command(
|
|
1100
|
+
'enable-ng',
|
|
1101
|
+
{
|
|
1102
|
+
description: 'Link Keycloak to a Network Group, used for multi-instances secure communication',
|
|
1103
|
+
args: [args.addonIdOrName],
|
|
1104
|
+
},
|
|
1105
|
+
keycloak.ngEnable,
|
|
1106
|
+
);
|
|
1107
|
+
const keycloakDisableNgCommand = cliparse.command(
|
|
1108
|
+
'disable-ng',
|
|
1109
|
+
{
|
|
1110
|
+
description: 'Unlink Keycloak from its Network Group',
|
|
1111
|
+
args: [args.addonIdOrName],
|
|
1112
|
+
},
|
|
1113
|
+
keycloak.ngDisable,
|
|
1114
|
+
);
|
|
1115
|
+
const keycloakOpenLogsCommand = cliparse.command(
|
|
1116
|
+
'logs',
|
|
1117
|
+
{
|
|
1118
|
+
description: 'Open the Keycloak application logs in Clever Cloud Console',
|
|
1119
|
+
args: [args.addonIdOrName],
|
|
1120
|
+
},
|
|
1121
|
+
keycloak.openLogs,
|
|
1122
|
+
);
|
|
1123
|
+
const keycloakOpenWebUiCommand = cliparse.command(
|
|
1124
|
+
'webui',
|
|
1125
|
+
{
|
|
1126
|
+
description: 'Open the Keycloak admin console in your browser',
|
|
1127
|
+
args: [args.addonIdOrName],
|
|
1128
|
+
},
|
|
1129
|
+
keycloak.openWebUi,
|
|
1130
|
+
);
|
|
1131
|
+
const keycloakOpenCommand = cliparse.command(
|
|
1132
|
+
'open',
|
|
1133
|
+
{
|
|
1134
|
+
description: 'Open the Keycloak dashboard in Clever Cloud Console',
|
|
1135
|
+
args: [args.addonIdOrName],
|
|
1136
|
+
commands: [keycloakOpenLogsCommand, keycloakOpenWebUiCommand],
|
|
1137
|
+
},
|
|
1138
|
+
keycloak.open,
|
|
1139
|
+
);
|
|
1140
|
+
const keycloakRestartCommand = cliparse.command(
|
|
1141
|
+
'restart',
|
|
1142
|
+
{
|
|
1143
|
+
description: 'Restart Keycloak',
|
|
1144
|
+
args: [args.addonIdOrName],
|
|
1145
|
+
},
|
|
1146
|
+
keycloak.reboot,
|
|
1147
|
+
);
|
|
1148
|
+
const keycloakRebuildCommand = cliparse.command(
|
|
1149
|
+
'rebuild',
|
|
1150
|
+
{
|
|
1151
|
+
description: 'Rebuild Keycloak',
|
|
1152
|
+
args: [args.addonIdOrName],
|
|
1153
|
+
},
|
|
1154
|
+
keycloak.rebuild,
|
|
1155
|
+
);
|
|
1156
|
+
const keycloakVersionCheckCommand = cliparse.command(
|
|
1157
|
+
'check',
|
|
1158
|
+
{
|
|
1159
|
+
description: 'Check Keycloak deployed version',
|
|
1160
|
+
args: [args.addonIdOrName],
|
|
1161
|
+
options: [opts.humanJsonOutputFormat],
|
|
1162
|
+
},
|
|
1163
|
+
keycloak.checkVersion,
|
|
1164
|
+
);
|
|
1165
|
+
const keycloakVersionUpdateCommand = cliparse.command(
|
|
1166
|
+
'update',
|
|
1167
|
+
{
|
|
1168
|
+
description: 'Update Keycloak deployed version',
|
|
1169
|
+
args: [args.addonIdOrName],
|
|
1170
|
+
options: [opts.targetVersion],
|
|
1171
|
+
},
|
|
1172
|
+
keycloak.updateVersion,
|
|
1173
|
+
);
|
|
1174
|
+
const keycloakVersionsCommands = cliparse.command(
|
|
1175
|
+
'version',
|
|
1176
|
+
{
|
|
1177
|
+
description: 'Check Keycloak deployed version',
|
|
1178
|
+
args: [args.addonIdOrName],
|
|
1179
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1180
|
+
commands: [keycloakVersionCheckCommand, keycloakVersionUpdateCommand],
|
|
1181
|
+
},
|
|
1182
|
+
keycloak.checkVersion,
|
|
1183
|
+
);
|
|
1184
|
+
const keycloakCommand = cliparse.command(
|
|
1185
|
+
'keycloak',
|
|
1186
|
+
{
|
|
1187
|
+
description: 'Manage Clever Cloud Keycloak services',
|
|
1188
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1189
|
+
commands: [
|
|
1190
|
+
keycloakGetCommand,
|
|
1191
|
+
keycloakEnableNgCommand,
|
|
1192
|
+
keycloakDisableNgCommand,
|
|
1193
|
+
keycloakOpenCommand,
|
|
1194
|
+
keycloakRestartCommand,
|
|
1195
|
+
keycloakRebuildCommand,
|
|
1196
|
+
keycloakVersionsCommands,
|
|
1197
|
+
],
|
|
1198
|
+
},
|
|
1199
|
+
keycloak.list,
|
|
1200
|
+
);
|
|
883
1201
|
|
|
884
1202
|
// KV COMMAND
|
|
885
|
-
const kvRawCommand = cliparse.command(
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1203
|
+
const kvRawCommand = cliparse.command(
|
|
1204
|
+
'kv',
|
|
1205
|
+
{
|
|
1206
|
+
description: 'Send a raw command to a Materia KV or Redis® add-on',
|
|
1207
|
+
args: [args.kvIdOrName, args.kvRawCommand],
|
|
1208
|
+
options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
|
|
1209
|
+
},
|
|
1210
|
+
kv.sendRawCommand,
|
|
1211
|
+
);
|
|
890
1212
|
|
|
891
1213
|
// LINK COMMAND
|
|
892
|
-
const appLinkCommand = cliparse.command(
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1214
|
+
const appLinkCommand = cliparse.command(
|
|
1215
|
+
'link',
|
|
1216
|
+
{
|
|
1217
|
+
description: 'Link this repo to an existing application',
|
|
1218
|
+
args: [args.appIdOrName],
|
|
1219
|
+
options: [opts.aliasCreation, opts.orgaIdOrName],
|
|
1220
|
+
},
|
|
1221
|
+
link.link,
|
|
1222
|
+
);
|
|
897
1223
|
|
|
898
1224
|
// LOGIN COMMAND
|
|
899
|
-
const loginCommand = cliparse.command(
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1225
|
+
const loginCommand = cliparse.command(
|
|
1226
|
+
'login',
|
|
1227
|
+
{
|
|
1228
|
+
description: 'Login to Clever Cloud',
|
|
1229
|
+
options: [opts.loginToken, opts.loginSecret],
|
|
1230
|
+
},
|
|
1231
|
+
login.login,
|
|
1232
|
+
);
|
|
903
1233
|
|
|
904
1234
|
// LOGOUT COMMAND
|
|
905
|
-
const logoutCommand = cliparse.command(
|
|
906
|
-
|
|
907
|
-
|
|
1235
|
+
const logoutCommand = cliparse.command(
|
|
1236
|
+
'logout',
|
|
1237
|
+
{
|
|
1238
|
+
description: 'Logout from Clever Cloud',
|
|
1239
|
+
},
|
|
1240
|
+
logout.logout,
|
|
1241
|
+
);
|
|
908
1242
|
|
|
909
1243
|
// LOGS COMMAND
|
|
910
|
-
const logsCommand = cliparse.command(
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
1244
|
+
const logsCommand = cliparse.command(
|
|
1245
|
+
'logs',
|
|
1246
|
+
{
|
|
1247
|
+
description: 'Fetch application logs, continuously',
|
|
1248
|
+
options: [
|
|
1249
|
+
opts.alias,
|
|
1250
|
+
opts.appIdOrName,
|
|
1251
|
+
opts.before,
|
|
1252
|
+
opts.after,
|
|
1253
|
+
opts.search,
|
|
1254
|
+
opts.deploymentId,
|
|
1255
|
+
opts.addonId,
|
|
1256
|
+
opts.logsFormat,
|
|
1257
|
+
],
|
|
1258
|
+
},
|
|
1259
|
+
logs.appLogs,
|
|
1260
|
+
);
|
|
914
1261
|
|
|
915
1262
|
// MAKE DEFAULT COMMAND
|
|
916
|
-
const makeDefaultCommand = cliparse.command(
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
1263
|
+
const makeDefaultCommand = cliparse.command(
|
|
1264
|
+
'make-default',
|
|
1265
|
+
{
|
|
1266
|
+
description: 'Make a linked application the default one',
|
|
1267
|
+
args: [args.alias],
|
|
1268
|
+
},
|
|
1269
|
+
makeDefault.makeDefault,
|
|
1270
|
+
);
|
|
920
1271
|
|
|
921
1272
|
// MATOMO COMMAND
|
|
922
|
-
const matomoGetCommand = cliparse.command(
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1273
|
+
const matomoGetCommand = cliparse.command(
|
|
1274
|
+
'get',
|
|
1275
|
+
{
|
|
1276
|
+
description: 'Get information about a deployed Matomo',
|
|
1277
|
+
args: [args.addonIdOrName],
|
|
1278
|
+
options: [opts.humanJsonOutputFormat],
|
|
1279
|
+
},
|
|
1280
|
+
matomo.get,
|
|
1281
|
+
);
|
|
1282
|
+
const matomoOpenLogsCommand = cliparse.command(
|
|
1283
|
+
'logs',
|
|
1284
|
+
{
|
|
1285
|
+
description: 'Open the Matomo application logs in Clever Cloud Console',
|
|
1286
|
+
args: [args.addonIdOrName],
|
|
1287
|
+
},
|
|
1288
|
+
matomo.openLogs,
|
|
1289
|
+
);
|
|
1290
|
+
const matomoOpenWebUiCommand = cliparse.command(
|
|
1291
|
+
'webui',
|
|
1292
|
+
{
|
|
1293
|
+
description: 'Open the Matomo admin console in your browser',
|
|
1294
|
+
args: [args.addonIdOrName],
|
|
1295
|
+
},
|
|
1296
|
+
matomo.openWebUi,
|
|
1297
|
+
);
|
|
1298
|
+
const matomoOpenCommand = cliparse.command(
|
|
1299
|
+
'open',
|
|
1300
|
+
{
|
|
1301
|
+
description: 'Open the Matomo dashboard in Clever Cloud Console',
|
|
1302
|
+
args: [args.addonIdOrName],
|
|
1303
|
+
commands: [matomoOpenLogsCommand, matomoOpenWebUiCommand],
|
|
1304
|
+
},
|
|
1305
|
+
matomo.open,
|
|
1306
|
+
);
|
|
1307
|
+
const matomoRestartCommand = cliparse.command(
|
|
1308
|
+
'restart',
|
|
1309
|
+
{
|
|
1310
|
+
description: 'Restart Matomo',
|
|
1311
|
+
args: [args.addonIdOrName],
|
|
1312
|
+
},
|
|
1313
|
+
matomo.reboot,
|
|
1314
|
+
);
|
|
1315
|
+
const matomoRebuildCommand = cliparse.command(
|
|
1316
|
+
'rebuild',
|
|
1317
|
+
{
|
|
1318
|
+
description: 'Rebuild Matomo',
|
|
1319
|
+
args: [args.addonIdOrName],
|
|
1320
|
+
},
|
|
1321
|
+
matomo.rebuild,
|
|
1322
|
+
);
|
|
1323
|
+
const matomoCommand = cliparse.command(
|
|
1324
|
+
'matomo',
|
|
1325
|
+
{
|
|
1326
|
+
description: 'Manage Clever Cloud Matomo services',
|
|
1327
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1328
|
+
commands: [matomoGetCommand, matomoOpenCommand, matomoRestartCommand, matomoRebuildCommand],
|
|
1329
|
+
},
|
|
1330
|
+
matomo.list,
|
|
1331
|
+
);
|
|
953
1332
|
|
|
954
1333
|
// METABASE COMMAND
|
|
955
|
-
const metabaseGetCommand = cliparse.command(
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1334
|
+
const metabaseGetCommand = cliparse.command(
|
|
1335
|
+
'get',
|
|
1336
|
+
{
|
|
1337
|
+
description: 'Get information about a deployed Metabase',
|
|
1338
|
+
args: [args.addonIdOrName],
|
|
1339
|
+
options: [opts.humanJsonOutputFormat],
|
|
1340
|
+
},
|
|
1341
|
+
metabase.get,
|
|
1342
|
+
);
|
|
1343
|
+
const metabaseOpenLogsCommand = cliparse.command(
|
|
1344
|
+
'logs',
|
|
1345
|
+
{
|
|
1346
|
+
description: 'Open the Metabase application logs in Clever Cloud Console',
|
|
1347
|
+
args: [args.addonIdOrName],
|
|
1348
|
+
},
|
|
1349
|
+
metabase.openLogs,
|
|
1350
|
+
);
|
|
1351
|
+
const metabaseOpenWebUiCommand = cliparse.command(
|
|
1352
|
+
'webui',
|
|
1353
|
+
{
|
|
1354
|
+
description: 'Open the Metabase admin console in your browser',
|
|
1355
|
+
args: [args.addonIdOrName],
|
|
1356
|
+
},
|
|
1357
|
+
metabase.openWebUi,
|
|
1358
|
+
);
|
|
1359
|
+
const metabaseOpenCommand = cliparse.command(
|
|
1360
|
+
'open',
|
|
1361
|
+
{
|
|
1362
|
+
description: 'Open the Metabase dashboard in Clever Cloud Console',
|
|
1363
|
+
args: [args.addonIdOrName],
|
|
1364
|
+
commands: [metabaseOpenLogsCommand, metabaseOpenWebUiCommand],
|
|
1365
|
+
},
|
|
1366
|
+
metabase.open,
|
|
1367
|
+
);
|
|
1368
|
+
const metabaseRestartCommand = cliparse.command(
|
|
1369
|
+
'restart',
|
|
1370
|
+
{
|
|
1371
|
+
description: 'Restart Metabase',
|
|
1372
|
+
args: [args.addonIdOrName],
|
|
1373
|
+
},
|
|
1374
|
+
metabase.reboot,
|
|
1375
|
+
);
|
|
1376
|
+
const metabaseRebuildCommand = cliparse.command(
|
|
1377
|
+
'rebuild',
|
|
1378
|
+
{
|
|
1379
|
+
description: 'Rebuild Metabase',
|
|
1380
|
+
args: [args.addonIdOrName],
|
|
1381
|
+
},
|
|
1382
|
+
metabase.rebuild,
|
|
1383
|
+
);
|
|
1384
|
+
const metabaseVersionCheckCommand = cliparse.command(
|
|
1385
|
+
'check',
|
|
1386
|
+
{
|
|
1387
|
+
description: 'Check Metabase deployed version',
|
|
1388
|
+
args: [args.addonIdOrName],
|
|
1389
|
+
options: [opts.humanJsonOutputFormat],
|
|
1390
|
+
},
|
|
1391
|
+
metabase.checkVersion,
|
|
1392
|
+
);
|
|
1393
|
+
const metabaseVersionUpdateCommand = cliparse.command(
|
|
1394
|
+
'update',
|
|
1395
|
+
{
|
|
1396
|
+
description: 'Update Metabase deployed version',
|
|
1397
|
+
args: [args.addonIdOrName],
|
|
1398
|
+
options: [opts.targetVersion],
|
|
1399
|
+
},
|
|
1400
|
+
metabase.updateVersion,
|
|
1401
|
+
);
|
|
1402
|
+
const metabaseVersionsCommands = cliparse.command(
|
|
1403
|
+
'version',
|
|
1404
|
+
{
|
|
1405
|
+
description: 'Manage Metabase deployed version',
|
|
1406
|
+
args: [args.addonIdOrName],
|
|
1407
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1408
|
+
commands: [metabaseVersionCheckCommand, metabaseVersionUpdateCommand],
|
|
1409
|
+
},
|
|
1410
|
+
metabase.checkVersion,
|
|
1411
|
+
);
|
|
1412
|
+
const metabaseCommand = cliparse.command(
|
|
1413
|
+
'metabase',
|
|
1414
|
+
{
|
|
1415
|
+
description: 'Manage Clever Cloud Metabase services',
|
|
1416
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1417
|
+
commands: [
|
|
1418
|
+
metabaseGetCommand,
|
|
1419
|
+
metabaseOpenCommand,
|
|
1420
|
+
metabaseRestartCommand,
|
|
1421
|
+
metabaseRebuildCommand,
|
|
1422
|
+
metabaseVersionsCommands,
|
|
1423
|
+
],
|
|
1424
|
+
},
|
|
1425
|
+
metabase.list,
|
|
1426
|
+
);
|
|
1002
1427
|
|
|
1003
1428
|
// NETWORK GROUP COMMANDS
|
|
1004
|
-
const ngCreateExternalPeerCommand = cliparse.command(
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1429
|
+
const ngCreateExternalPeerCommand = cliparse.command(
|
|
1430
|
+
'external',
|
|
1431
|
+
{
|
|
1432
|
+
description: 'Create an external peer in a Network Group',
|
|
1433
|
+
args: [args.ngExternalPeerLabel, args.ngIdOrLabel, args.wgPublicKey],
|
|
1434
|
+
},
|
|
1435
|
+
ng.createExternalPeer,
|
|
1436
|
+
);
|
|
1437
|
+
const ngDeleteExternalPeerCommand = cliparse.command(
|
|
1438
|
+
'external',
|
|
1439
|
+
{
|
|
1440
|
+
description: 'Delete an external peer from a Network Group',
|
|
1441
|
+
args: [args.ngExternalIdOrLabel, args.ngIdOrLabel],
|
|
1442
|
+
},
|
|
1443
|
+
ng.deleteExternalPeer,
|
|
1444
|
+
);
|
|
1445
|
+
const ngCreateCommand = cliparse.command(
|
|
1446
|
+
'create',
|
|
1447
|
+
{
|
|
1448
|
+
description: 'Create a Network Group',
|
|
1449
|
+
args: [args.ngLabel],
|
|
1450
|
+
privateOptions: [opts.ngMembersIdsToLink, opts.ngDescription, opts.optTags],
|
|
1451
|
+
commands: [ngCreateExternalPeerCommand],
|
|
1452
|
+
},
|
|
1453
|
+
ng.createNg,
|
|
1454
|
+
);
|
|
1455
|
+
const ngDeleteCommand = cliparse.command(
|
|
1456
|
+
'delete',
|
|
1457
|
+
{
|
|
1458
|
+
description: 'Delete a Network Group',
|
|
1459
|
+
args: [args.ngIdOrLabel],
|
|
1460
|
+
commands: [ngDeleteExternalPeerCommand],
|
|
1461
|
+
},
|
|
1462
|
+
ng.deleteNg,
|
|
1463
|
+
);
|
|
1464
|
+
const ngLinkCommand = cliparse.command(
|
|
1465
|
+
'link',
|
|
1466
|
+
{
|
|
1467
|
+
description: 'Link an application or a database add-on by its ID to a Network Group',
|
|
1468
|
+
args: [args.ngAnyIdOrLabel, args.ngIdOrLabel],
|
|
1469
|
+
},
|
|
1470
|
+
ng.linkToNg,
|
|
1471
|
+
);
|
|
1472
|
+
const ngUnlinkCommand = cliparse.command(
|
|
1473
|
+
'unlink',
|
|
1474
|
+
{
|
|
1475
|
+
description: 'Unlink an application or a database add-on by its ID from a Network Group',
|
|
1476
|
+
args: [args.ngAnyIdOrLabel, args.ngIdOrLabel],
|
|
1477
|
+
},
|
|
1478
|
+
ng.unlinkFromNg,
|
|
1479
|
+
);
|
|
1480
|
+
const ngGetCommand = cliparse.command(
|
|
1481
|
+
'get',
|
|
1482
|
+
{
|
|
1483
|
+
description: 'Get details about a Network Group, a member or a peer',
|
|
1484
|
+
args: [args.ngAnyIdOrLabel],
|
|
1485
|
+
options: [opts.ngResourceType, opts.humanJsonOutputFormat],
|
|
1486
|
+
},
|
|
1487
|
+
ng.get,
|
|
1488
|
+
);
|
|
1489
|
+
const ngGetConfigCommand = cliparse.command(
|
|
1490
|
+
'get-config',
|
|
1491
|
+
{
|
|
1492
|
+
description: 'Get the Wireguard configuration of a peer in a Network Group',
|
|
1493
|
+
args: [args.ngExternalIdOrLabel, args.ngIdOrLabel],
|
|
1494
|
+
options: [opts.humanJsonOutputFormat],
|
|
1495
|
+
},
|
|
1496
|
+
ng.getPeerConfig,
|
|
1497
|
+
);
|
|
1498
|
+
const ngSearchCommand = cliparse.command(
|
|
1499
|
+
'search',
|
|
1500
|
+
{
|
|
1501
|
+
description: 'Search Network Groups, members or peers and get their details',
|
|
1502
|
+
args: [args.ngAnyIdOrLabel],
|
|
1503
|
+
options: [opts.ngResourceType, opts.humanJsonOutputFormat],
|
|
1504
|
+
},
|
|
1505
|
+
ng.search,
|
|
1506
|
+
);
|
|
1507
|
+
const networkGroupsCommand = cliparse.command(
|
|
1508
|
+
'ng',
|
|
1509
|
+
{
|
|
1510
|
+
description: 'List Network Groups',
|
|
1511
|
+
options: [opts.orgaIdOrName],
|
|
1512
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1513
|
+
commands: [
|
|
1514
|
+
ngCreateCommand,
|
|
1515
|
+
ngDeleteCommand,
|
|
1516
|
+
ngLinkCommand,
|
|
1517
|
+
ngUnlinkCommand,
|
|
1518
|
+
ngGetCommand,
|
|
1519
|
+
ngGetConfigCommand,
|
|
1520
|
+
ngSearchCommand,
|
|
1521
|
+
],
|
|
1522
|
+
},
|
|
1523
|
+
ng.listNg,
|
|
1524
|
+
);
|
|
1052
1525
|
|
|
1053
1526
|
// NOTIFY-EMAIL COMMAND
|
|
1054
|
-
const addEmailNotificationCommand = cliparse.command(
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1527
|
+
const addEmailNotificationCommand = cliparse.command(
|
|
1528
|
+
'add',
|
|
1529
|
+
{
|
|
1530
|
+
description: 'Add a new email notification',
|
|
1531
|
+
options: [opts.notificationEventType, opts.notificationScope, opts.emailNotificationTarget],
|
|
1532
|
+
args: [args.notificationName],
|
|
1533
|
+
},
|
|
1534
|
+
notifyEmail.add,
|
|
1535
|
+
);
|
|
1536
|
+
const removeEmailNotificationCommand = cliparse.command(
|
|
1537
|
+
'remove',
|
|
1538
|
+
{
|
|
1539
|
+
description: 'Remove an existing email notification',
|
|
1540
|
+
args: [args.notificationId],
|
|
1541
|
+
},
|
|
1542
|
+
notifyEmail.remove,
|
|
1543
|
+
);
|
|
1544
|
+
const emailNotificationsCommand = cliparse.command(
|
|
1545
|
+
'notify-email',
|
|
1546
|
+
{
|
|
1547
|
+
description: 'Manage email notifications',
|
|
1548
|
+
options: [opts.orgaIdOrName, opts.listAllNotifications],
|
|
1549
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1550
|
+
commands: [addEmailNotificationCommand, removeEmailNotificationCommand],
|
|
1551
|
+
},
|
|
1552
|
+
notifyEmail.list,
|
|
1553
|
+
);
|
|
1069
1554
|
|
|
1070
1555
|
// OPEN COMMAND
|
|
1071
|
-
const openCommand = cliparse.command(
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1556
|
+
const openCommand = cliparse.command(
|
|
1557
|
+
'open',
|
|
1558
|
+
{
|
|
1559
|
+
description: 'Open an application in the Console',
|
|
1560
|
+
options: [opts.alias, opts.appIdOrName],
|
|
1561
|
+
},
|
|
1562
|
+
open.open,
|
|
1563
|
+
);
|
|
1075
1564
|
|
|
1076
1565
|
// OTOROSHI COMMAND
|
|
1077
|
-
const otoroshiGetCommand = cliparse.command(
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1566
|
+
const otoroshiGetCommand = cliparse.command(
|
|
1567
|
+
'get',
|
|
1568
|
+
{
|
|
1569
|
+
description: 'Get information about a deployed Otoroshi',
|
|
1570
|
+
args: [args.addonIdOrName],
|
|
1571
|
+
options: [opts.humanJsonOutputFormat],
|
|
1572
|
+
},
|
|
1573
|
+
otoroshi.get,
|
|
1574
|
+
);
|
|
1575
|
+
const otoroshiEnableNgCommand = cliparse.command(
|
|
1576
|
+
'enable-ng',
|
|
1577
|
+
{
|
|
1578
|
+
description: 'Link Otoroshi to a Network Group',
|
|
1579
|
+
args: [args.addonIdOrName],
|
|
1580
|
+
},
|
|
1581
|
+
otoroshi.ngEnable,
|
|
1582
|
+
);
|
|
1583
|
+
const otoroshiDisableNgCommand = cliparse.command(
|
|
1584
|
+
'disable-ng',
|
|
1585
|
+
{
|
|
1586
|
+
description: 'Unlink Otoroshi from its Network Group',
|
|
1587
|
+
args: [args.addonIdOrName],
|
|
1588
|
+
},
|
|
1589
|
+
otoroshi.ngDisable,
|
|
1590
|
+
);
|
|
1591
|
+
const otoroshiOpenLogsCommand = cliparse.command(
|
|
1592
|
+
'logs',
|
|
1593
|
+
{
|
|
1594
|
+
description: 'Open the Otoroshi application logs in Clever Cloud Console',
|
|
1595
|
+
args: [args.addonIdOrName],
|
|
1596
|
+
},
|
|
1597
|
+
otoroshi.openLogs,
|
|
1598
|
+
);
|
|
1599
|
+
const otoroshiOpenWebUiCommand = cliparse.command(
|
|
1600
|
+
'webui',
|
|
1601
|
+
{
|
|
1602
|
+
description: 'Open the Otoroshi admin console in your browser',
|
|
1603
|
+
args: [args.addonIdOrName],
|
|
1604
|
+
},
|
|
1605
|
+
otoroshi.openWebUi,
|
|
1606
|
+
);
|
|
1607
|
+
const otoroshiOpenCommand = cliparse.command(
|
|
1608
|
+
'open',
|
|
1609
|
+
{
|
|
1610
|
+
description: 'Open the Otoroshi dashboard in Clever Cloud Console',
|
|
1611
|
+
args: [args.addonIdOrName],
|
|
1612
|
+
commands: [otoroshiOpenLogsCommand, otoroshiOpenWebUiCommand],
|
|
1613
|
+
},
|
|
1614
|
+
otoroshi.open,
|
|
1615
|
+
);
|
|
1616
|
+
const otoroshiRestartCommand = cliparse.command(
|
|
1617
|
+
'restart',
|
|
1618
|
+
{
|
|
1619
|
+
description: 'Restart Otoroshi',
|
|
1620
|
+
args: [args.addonIdOrName],
|
|
1621
|
+
},
|
|
1622
|
+
otoroshi.reboot,
|
|
1623
|
+
);
|
|
1624
|
+
const otoroshiRebuildCommand = cliparse.command(
|
|
1625
|
+
'rebuild',
|
|
1626
|
+
{
|
|
1627
|
+
description: 'Rebuild Otoroshi',
|
|
1628
|
+
args: [args.addonIdOrName],
|
|
1629
|
+
},
|
|
1630
|
+
otoroshi.rebuild,
|
|
1631
|
+
);
|
|
1632
|
+
const otoroshiVersionCheckCommand = cliparse.command(
|
|
1633
|
+
'check',
|
|
1634
|
+
{
|
|
1635
|
+
description: 'Check Otoroshi deployed version',
|
|
1636
|
+
args: [args.addonIdOrName],
|
|
1637
|
+
options: [opts.humanJsonOutputFormat],
|
|
1638
|
+
},
|
|
1639
|
+
otoroshi.checkVersion,
|
|
1640
|
+
);
|
|
1641
|
+
const otoroshiVersionUpdateCommand = cliparse.command(
|
|
1642
|
+
'update',
|
|
1643
|
+
{
|
|
1644
|
+
description: 'Update Otoroshi deployed version',
|
|
1645
|
+
args: [args.addonIdOrName],
|
|
1646
|
+
options: [opts.targetVersion],
|
|
1647
|
+
},
|
|
1648
|
+
otoroshi.updateVersion,
|
|
1649
|
+
);
|
|
1650
|
+
const otoroshiVersionsCommands = cliparse.command(
|
|
1651
|
+
'version',
|
|
1652
|
+
{
|
|
1653
|
+
description: 'Manage Otoroshi deployed version',
|
|
1654
|
+
args: [args.addonIdOrName],
|
|
1655
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1656
|
+
commands: [otoroshiVersionCheckCommand, otoroshiVersionUpdateCommand],
|
|
1657
|
+
},
|
|
1658
|
+
otoroshi.checkVersion,
|
|
1659
|
+
);
|
|
1660
|
+
const otoroshiCommand = cliparse.command(
|
|
1661
|
+
'otoroshi',
|
|
1662
|
+
{
|
|
1663
|
+
description: 'Manage Clever Cloud Otoroshi services',
|
|
1664
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1665
|
+
commands: [
|
|
1666
|
+
otoroshiGetCommand,
|
|
1667
|
+
otoroshiEnableNgCommand,
|
|
1668
|
+
otoroshiDisableNgCommand,
|
|
1669
|
+
otoroshiOpenCommand,
|
|
1670
|
+
otoroshiRestartCommand,
|
|
1671
|
+
otoroshiRebuildCommand,
|
|
1672
|
+
otoroshiVersionsCommands,
|
|
1673
|
+
],
|
|
1674
|
+
},
|
|
1675
|
+
otoroshi.list,
|
|
1676
|
+
);
|
|
1132
1677
|
|
|
1133
1678
|
// CONSOLE COMMAND
|
|
1134
|
-
const consoleCommand = cliparse.command(
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1679
|
+
const consoleCommand = cliparse.command(
|
|
1680
|
+
'console',
|
|
1681
|
+
{
|
|
1682
|
+
description: 'Open an application in the Console',
|
|
1683
|
+
options: [opts.alias, opts.appIdOrName],
|
|
1684
|
+
},
|
|
1685
|
+
consoleModule.openConsole,
|
|
1686
|
+
);
|
|
1138
1687
|
|
|
1139
1688
|
// PROFILE COMMAND
|
|
1140
|
-
const profileOpenCommand = cliparse.command(
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1689
|
+
const profileOpenCommand = cliparse.command(
|
|
1690
|
+
'open',
|
|
1691
|
+
{
|
|
1692
|
+
description: 'Open your profile in the Console',
|
|
1693
|
+
},
|
|
1694
|
+
profile.openProfile,
|
|
1695
|
+
);
|
|
1696
|
+
const profileCommand = cliparse.command(
|
|
1697
|
+
'profile',
|
|
1698
|
+
{
|
|
1699
|
+
description: 'Display the profile of the current user',
|
|
1700
|
+
options: [opts.humanJsonOutputFormat],
|
|
1701
|
+
commands: [profileOpenCommand],
|
|
1702
|
+
},
|
|
1703
|
+
profile.profile,
|
|
1704
|
+
);
|
|
1148
1705
|
|
|
1149
1706
|
// PUBLISHED CONFIG COMMANDS
|
|
1150
|
-
const publishedConfigSetCommand = cliparse.command(
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1707
|
+
const publishedConfigSetCommand = cliparse.command(
|
|
1708
|
+
'set',
|
|
1709
|
+
{
|
|
1710
|
+
description: 'Add or update a published configuration item named <variable-name> with the value <variable-value>',
|
|
1711
|
+
args: [args.envVariableName, args.envVariableValue],
|
|
1712
|
+
},
|
|
1713
|
+
publishedConfig.set,
|
|
1714
|
+
);
|
|
1715
|
+
const publishedConfigRemoveCommand = cliparse.command(
|
|
1716
|
+
'rm',
|
|
1717
|
+
{
|
|
1718
|
+
description: 'Remove a published configuration variable from an application',
|
|
1719
|
+
args: [args.envVariableName],
|
|
1720
|
+
},
|
|
1721
|
+
publishedConfig.rm,
|
|
1722
|
+
);
|
|
1723
|
+
const publishedConfigImportCommand = cliparse.command(
|
|
1724
|
+
'import',
|
|
1725
|
+
{
|
|
1726
|
+
description:
|
|
1727
|
+
'Load published configuration from STDIN\n(WARNING: this deletes all current variables and replace them with the new list loaded from STDIN)',
|
|
1728
|
+
options: [opts.importAsJson],
|
|
1729
|
+
},
|
|
1730
|
+
publishedConfig.importEnv,
|
|
1731
|
+
);
|
|
1732
|
+
const publishedConfigCommands = cliparse.command(
|
|
1733
|
+
'published-config',
|
|
1734
|
+
{
|
|
1735
|
+
description: 'Manage the configuration made available to other applications by this application',
|
|
1736
|
+
options: [opts.alias, opts.appIdOrName],
|
|
1737
|
+
privateOptions: [opts.envFormat],
|
|
1738
|
+
commands: [publishedConfigSetCommand, publishedConfigRemoveCommand, publishedConfigImportCommand],
|
|
1739
|
+
},
|
|
1740
|
+
publishedConfig.list,
|
|
1741
|
+
);
|
|
1168
1742
|
|
|
1169
1743
|
// RESTART COMMAND
|
|
1170
|
-
const restartCommand = cliparse.command(
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1744
|
+
const restartCommand = cliparse.command(
|
|
1745
|
+
'restart',
|
|
1746
|
+
{
|
|
1747
|
+
description: 'Start or restart an application',
|
|
1748
|
+
options: [
|
|
1749
|
+
opts.alias,
|
|
1750
|
+
opts.appIdOrName,
|
|
1751
|
+
opts.commit,
|
|
1752
|
+
opts.withoutCache,
|
|
1753
|
+
opts.quiet,
|
|
1754
|
+
opts.followDeployLogs,
|
|
1755
|
+
opts.exitOnDeploy,
|
|
1756
|
+
],
|
|
1757
|
+
},
|
|
1758
|
+
restart.restart,
|
|
1759
|
+
);
|
|
1174
1760
|
|
|
1175
1761
|
// SCALE COMMAND
|
|
1176
|
-
const scaleCommand = cliparse.command(
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1762
|
+
const scaleCommand = cliparse.command(
|
|
1763
|
+
'scale',
|
|
1764
|
+
{
|
|
1765
|
+
description: 'Change scalability of an application',
|
|
1766
|
+
options: [
|
|
1767
|
+
opts.alias,
|
|
1768
|
+
opts.appIdOrName,
|
|
1769
|
+
opts.flavor,
|
|
1770
|
+
opts.minFlavor,
|
|
1771
|
+
opts.maxFlavor,
|
|
1772
|
+
opts.instances,
|
|
1773
|
+
opts.minInstances,
|
|
1774
|
+
opts.maxInstances,
|
|
1775
|
+
opts.buildFlavor,
|
|
1776
|
+
],
|
|
1777
|
+
},
|
|
1778
|
+
scale.scale,
|
|
1779
|
+
);
|
|
1180
1780
|
|
|
1181
1781
|
// SERVICE COMMANDS
|
|
1182
|
-
const serviceLinkAppCommand = cliparse.command(
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1782
|
+
const serviceLinkAppCommand = cliparse.command(
|
|
1783
|
+
'link-app',
|
|
1784
|
+
{
|
|
1785
|
+
description: 'Add an existing app as a dependency',
|
|
1786
|
+
args: [args.appIdOrName],
|
|
1787
|
+
},
|
|
1788
|
+
service.linkApp,
|
|
1789
|
+
);
|
|
1790
|
+
const serviceUnlinkAppCommand = cliparse.command(
|
|
1791
|
+
'unlink-app',
|
|
1792
|
+
{
|
|
1793
|
+
description: 'Remove an app from the dependencies',
|
|
1794
|
+
args: [args.appIdOrName],
|
|
1795
|
+
},
|
|
1796
|
+
service.unlinkApp,
|
|
1797
|
+
);
|
|
1798
|
+
const serviceLinkAddonCommand = cliparse.command(
|
|
1799
|
+
'link-addon',
|
|
1800
|
+
{
|
|
1801
|
+
description: 'Link an existing add-on to this application',
|
|
1802
|
+
args: [args.addonIdOrName],
|
|
1803
|
+
},
|
|
1804
|
+
service.linkAddon,
|
|
1805
|
+
);
|
|
1806
|
+
const serviceUnlinkAddonCommand = cliparse.command(
|
|
1807
|
+
'unlink-addon',
|
|
1808
|
+
{
|
|
1809
|
+
description: 'Unlink an add-on from this application',
|
|
1810
|
+
args: [args.addonIdOrName],
|
|
1811
|
+
},
|
|
1812
|
+
service.unlinkAddon,
|
|
1813
|
+
);
|
|
1814
|
+
const serviceCommands = cliparse.command(
|
|
1815
|
+
'service',
|
|
1816
|
+
{
|
|
1817
|
+
description: 'Manage service dependencies',
|
|
1818
|
+
options: [opts.alias, opts.appIdOrName, opts.onlyApps, opts.onlyAddons, opts.showAll],
|
|
1819
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1820
|
+
commands: [serviceLinkAppCommand, serviceUnlinkAppCommand, serviceLinkAddonCommand, serviceUnlinkAddonCommand],
|
|
1821
|
+
},
|
|
1822
|
+
service.list,
|
|
1823
|
+
);
|
|
1204
1824
|
|
|
1205
1825
|
// SSH COMMAND
|
|
1206
|
-
const sshCommand = cliparse.command(
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1826
|
+
const sshCommand = cliparse.command(
|
|
1827
|
+
'ssh',
|
|
1828
|
+
{
|
|
1829
|
+
description: 'Connect to running instances through SSH',
|
|
1830
|
+
options: [opts.alias, opts.appIdOrName, opts.sshIdentityFile],
|
|
1831
|
+
},
|
|
1832
|
+
ssh.ssh,
|
|
1833
|
+
);
|
|
1210
1834
|
|
|
1211
1835
|
// SSH KEYS COMMANDS
|
|
1212
|
-
const sshKeysAddCommand = cliparse.command(
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1836
|
+
const sshKeysAddCommand = cliparse.command(
|
|
1837
|
+
'add',
|
|
1838
|
+
{
|
|
1839
|
+
description: 'Add a new SSH key to the current user',
|
|
1840
|
+
args: [args.sshKeyName, args.sshKeyPath],
|
|
1841
|
+
},
|
|
1842
|
+
sshKeys.add,
|
|
1843
|
+
);
|
|
1844
|
+
const sshKeysRemoveCommand = cliparse.command(
|
|
1845
|
+
'remove',
|
|
1846
|
+
{
|
|
1847
|
+
description: 'Remove a SSH key from the current user',
|
|
1848
|
+
args: [args.sshKeyName],
|
|
1849
|
+
},
|
|
1850
|
+
sshKeys.remove,
|
|
1851
|
+
);
|
|
1852
|
+
const sshKeysRemoveAllCommand = cliparse.command(
|
|
1853
|
+
'remove-all',
|
|
1854
|
+
{
|
|
1855
|
+
description: 'Remove all SSH keys from the current user',
|
|
1856
|
+
options: [opts.confirmSshKeyClean],
|
|
1857
|
+
},
|
|
1858
|
+
sshKeys.removeAll,
|
|
1859
|
+
);
|
|
1860
|
+
const sshKeysOpenConsoleCommand = cliparse.command(
|
|
1861
|
+
'open',
|
|
1862
|
+
{
|
|
1863
|
+
description: 'Open the SSH keys management page in the Console',
|
|
1864
|
+
},
|
|
1865
|
+
sshKeys.openConsole,
|
|
1866
|
+
);
|
|
1867
|
+
const sshKeysCommands = cliparse.command(
|
|
1868
|
+
'ssh-keys',
|
|
1869
|
+
{
|
|
1870
|
+
description: 'Manage SSH keys of the current user',
|
|
1871
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1872
|
+
commands: [sshKeysAddCommand, sshKeysRemoveCommand, sshKeysRemoveAllCommand, sshKeysOpenConsoleCommand],
|
|
1873
|
+
},
|
|
1874
|
+
sshKeys.list,
|
|
1875
|
+
);
|
|
1232
1876
|
|
|
1233
1877
|
// STATUS COMMAND
|
|
1234
|
-
const statusCommand = cliparse.command(
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1878
|
+
const statusCommand = cliparse.command(
|
|
1879
|
+
'status',
|
|
1880
|
+
{
|
|
1881
|
+
description: 'See the status of an application',
|
|
1882
|
+
options: [opts.alias, opts.appIdOrName, opts.humanJsonOutputFormat],
|
|
1883
|
+
},
|
|
1884
|
+
status.status,
|
|
1885
|
+
);
|
|
1238
1886
|
|
|
1239
1887
|
// STOP COMMAND
|
|
1240
|
-
const stopCommand = cliparse.command(
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1888
|
+
const stopCommand = cliparse.command(
|
|
1889
|
+
'stop',
|
|
1890
|
+
{
|
|
1891
|
+
description: 'Stop a running application',
|
|
1892
|
+
options: [opts.alias, opts.appIdOrName],
|
|
1893
|
+
},
|
|
1894
|
+
stop.stop,
|
|
1895
|
+
);
|
|
1244
1896
|
|
|
1245
1897
|
// TCP-REDIRS COMMAND
|
|
1246
|
-
const tcpRedirsListNamespacesCommand = cliparse.command(
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1898
|
+
const tcpRedirsListNamespacesCommand = cliparse.command(
|
|
1899
|
+
'list-namespaces',
|
|
1900
|
+
{
|
|
1901
|
+
description: 'List the namespaces in which you can create new TCP redirections',
|
|
1902
|
+
options: [opts.humanJsonOutputFormat],
|
|
1903
|
+
},
|
|
1904
|
+
tcpRedirs.listNamespaces,
|
|
1905
|
+
);
|
|
1906
|
+
const tcpRedirsAddCommand = cliparse.command(
|
|
1907
|
+
'add',
|
|
1908
|
+
{
|
|
1909
|
+
description: 'Add a new TCP redirection to the application',
|
|
1910
|
+
options: [opts.namespace, opts.confirmTcpRedirCreation],
|
|
1911
|
+
},
|
|
1912
|
+
tcpRedirs.add,
|
|
1913
|
+
);
|
|
1914
|
+
const tcpRedirsRemoveCommand = cliparse.command(
|
|
1915
|
+
'remove',
|
|
1916
|
+
{
|
|
1917
|
+
description: 'Remove a TCP redirection from the application',
|
|
1918
|
+
options: [opts.namespace],
|
|
1919
|
+
args: [args.port],
|
|
1920
|
+
},
|
|
1921
|
+
tcpRedirs.remove,
|
|
1922
|
+
);
|
|
1923
|
+
const tcpRedirsCommands = cliparse.command(
|
|
1924
|
+
'tcp-redirs',
|
|
1925
|
+
{
|
|
1926
|
+
description: 'Control the TCP redirections from reverse proxies to your application',
|
|
1927
|
+
options: [opts.alias, opts.appIdOrName],
|
|
1928
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1929
|
+
commands: [tcpRedirsListNamespacesCommand, tcpRedirsAddCommand, tcpRedirsRemoveCommand],
|
|
1930
|
+
},
|
|
1931
|
+
tcpRedirs.list,
|
|
1932
|
+
);
|
|
1265
1933
|
|
|
1266
1934
|
// TOKENS COMMANDS
|
|
1267
|
-
const apiTokenCreateCommand = cliparse.command(
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1935
|
+
const apiTokenCreateCommand = cliparse.command(
|
|
1936
|
+
'create',
|
|
1937
|
+
{
|
|
1938
|
+
description: 'Create an API token',
|
|
1939
|
+
args: [args.apiTokenName],
|
|
1940
|
+
options: [opts.apiTokenExpiration, opts.humanJsonOutputFormat],
|
|
1941
|
+
},
|
|
1942
|
+
tokens.create,
|
|
1943
|
+
);
|
|
1944
|
+
const apiTokenRevokeCommand = cliparse.command(
|
|
1945
|
+
'revoke',
|
|
1946
|
+
{
|
|
1947
|
+
description: 'Revoke an API token',
|
|
1948
|
+
args: [args.apiTokenId],
|
|
1949
|
+
},
|
|
1950
|
+
tokens.revoke,
|
|
1951
|
+
);
|
|
1952
|
+
const tokensCommands = cliparse.command(
|
|
1953
|
+
'tokens',
|
|
1954
|
+
{
|
|
1955
|
+
description: `Manage API tokens to query Clever Cloud API from ${conf.AUTH_BRIDGE_HOST}`,
|
|
1956
|
+
commands: [apiTokenCreateCommand, apiTokenRevokeCommand],
|
|
1957
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
1958
|
+
},
|
|
1959
|
+
tokens.list,
|
|
1960
|
+
);
|
|
1281
1961
|
|
|
1282
1962
|
// UNLINK COMMAND
|
|
1283
|
-
const appUnlinkCommand = cliparse.command(
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1963
|
+
const appUnlinkCommand = cliparse.command(
|
|
1964
|
+
'unlink',
|
|
1965
|
+
{
|
|
1966
|
+
description: 'Unlink this repo from an existing application',
|
|
1967
|
+
args: [args.alias],
|
|
1968
|
+
},
|
|
1969
|
+
unlink.unlink,
|
|
1970
|
+
);
|
|
1287
1971
|
|
|
1288
1972
|
// VERSION COMMAND
|
|
1289
|
-
const versionCommand = cliparse.command(
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1973
|
+
const versionCommand = cliparse.command(
|
|
1974
|
+
'version',
|
|
1975
|
+
{
|
|
1976
|
+
description: 'Display the clever-tools version',
|
|
1977
|
+
args: [],
|
|
1978
|
+
},
|
|
1979
|
+
version.version,
|
|
1980
|
+
);
|
|
1293
1981
|
|
|
1294
1982
|
// WEBHOOKS COMMAND
|
|
1295
|
-
const addWebhookCommand = cliparse.command(
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1983
|
+
const addWebhookCommand = cliparse.command(
|
|
1984
|
+
'add',
|
|
1985
|
+
{
|
|
1986
|
+
description: 'Register webhook to be called when events happen',
|
|
1987
|
+
options: [opts.webhookFormat, opts.notificationEventType, opts.notificationScope],
|
|
1988
|
+
args: [args.notificationName, args.webhookUrl],
|
|
1989
|
+
},
|
|
1990
|
+
webhooks.add,
|
|
1991
|
+
);
|
|
1992
|
+
const removeWebhookCommand = cliparse.command(
|
|
1993
|
+
'remove',
|
|
1994
|
+
{
|
|
1995
|
+
description: 'Remove an existing webhook',
|
|
1996
|
+
args: [args.notificationId],
|
|
1997
|
+
},
|
|
1998
|
+
webhooks.remove,
|
|
1999
|
+
);
|
|
2000
|
+
const webhooksCommand = cliparse.command(
|
|
2001
|
+
'webhooks',
|
|
2002
|
+
{
|
|
2003
|
+
description: 'Manage webhooks',
|
|
2004
|
+
options: [opts.orgaIdOrName, opts.listAllNotifications],
|
|
2005
|
+
privateOptions: [opts.humanJsonOutputFormat],
|
|
2006
|
+
commands: [addWebhookCommand, removeWebhookCommand],
|
|
2007
|
+
},
|
|
2008
|
+
webhooks.list,
|
|
2009
|
+
);
|
|
1310
2010
|
|
|
1311
2011
|
// DATABASES COMMANDS
|
|
1312
|
-
const downloadBackupCommand = cliparse.command(
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
2012
|
+
const downloadBackupCommand = cliparse.command(
|
|
2013
|
+
'download',
|
|
2014
|
+
{
|
|
2015
|
+
description: 'Download a database backup',
|
|
2016
|
+
args: [args.databaseId, args.backupId],
|
|
2017
|
+
options: [opts.output],
|
|
2018
|
+
},
|
|
2019
|
+
database.downloadBackups,
|
|
2020
|
+
);
|
|
2021
|
+
const backupsCommand = cliparse.command(
|
|
2022
|
+
'backups',
|
|
2023
|
+
{
|
|
2024
|
+
description: 'List available database backups',
|
|
2025
|
+
args: [args.databaseId],
|
|
2026
|
+
options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
|
|
2027
|
+
commands: [downloadBackupCommand],
|
|
2028
|
+
},
|
|
2029
|
+
database.listBackups,
|
|
2030
|
+
);
|
|
2031
|
+
const databaseCommand = cliparse.command(
|
|
2032
|
+
'database',
|
|
2033
|
+
{
|
|
2034
|
+
description: 'List available databases',
|
|
2035
|
+
commands: [backupsCommand],
|
|
2036
|
+
},
|
|
2037
|
+
async () => {
|
|
2038
|
+
console.info('This command is not available, you can try the following commands:');
|
|
2039
|
+
console.info('clever database backups');
|
|
2040
|
+
console.info('clever database backups download');
|
|
2041
|
+
},
|
|
2042
|
+
);
|
|
1333
2043
|
|
|
1334
2044
|
// Patch help command description
|
|
1335
2045
|
cliparseCommands.helpCommand.description = 'Display help about the Clever Cloud CLI';
|
|
@@ -1398,8 +2108,8 @@ async function run () {
|
|
|
1398
2108
|
// CLI PARSER
|
|
1399
2109
|
const cliParser = cliparse.cli({
|
|
1400
2110
|
name: 'clever',
|
|
1401
|
-
description:
|
|
1402
|
-
version:
|
|
2111
|
+
description: "CLI tool to manage Clever Cloud's data and products",
|
|
2112
|
+
version: pkg.version,
|
|
1403
2113
|
options: [opts.color, opts.updateNotifier, opts.verbose],
|
|
1404
2114
|
helpCommand: false,
|
|
1405
2115
|
commands: _sortBy(commands, 'name'),
|
|
@@ -1415,7 +2125,6 @@ async function run () {
|
|
|
1415
2125
|
// cliparse doesn't allow unknown options/arguments
|
|
1416
2126
|
if (process.argv[2] === 'curl') {
|
|
1417
2127
|
curl();
|
|
1418
|
-
}
|
|
1419
|
-
else {
|
|
2128
|
+
} else {
|
|
1420
2129
|
run();
|
|
1421
2130
|
}
|