@heroku-cli/plugin-data-privatelink 1.3.1 → 1.3.2
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/LICENSE.md +206 -0
- package/README.md +558 -97
- package/lib/base.d.ts +2 -2
- package/lib/base.js +2 -2
- package/lib/commands/data/privatelink/access/add.d.ts +7 -7
- package/lib/commands/data/privatelink/access/add.js +25 -28
- package/lib/commands/data/privatelink/access/index.d.ts +7 -6
- package/lib/commands/data/privatelink/access/index.js +21 -19
- package/lib/commands/data/privatelink/access/remove.d.ts +7 -7
- package/lib/commands/data/privatelink/access/remove.js +25 -28
- package/lib/commands/data/privatelink/create.d.ts +7 -7
- package/lib/commands/data/privatelink/create.js +31 -34
- package/lib/commands/data/privatelink/destroy.d.ts +6 -6
- package/lib/commands/data/privatelink/destroy.js +17 -16
- package/lib/commands/data/privatelink/index.d.ts +8 -6
- package/lib/commands/data/privatelink/index.js +41 -31
- package/lib/commands/data/privatelink/wait.d.ts +6 -6
- package/lib/commands/data/privatelink/wait.js +19 -18
- package/oclif.manifest.json +314 -1
- package/package.json +59 -35
- package/yarn.lock +6082 -2067
- package/lib/lib/addontype.d.ts +0 -1
- package/lib/lib/addontype.js +0 -14
package/lib/base.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { APIClient, Command } from '@heroku-cli/command';
|
|
2
|
-
import {
|
|
2
|
+
import { Config } from '@oclif/core';
|
|
3
3
|
export default abstract class extends Command {
|
|
4
4
|
shogun: APIClient;
|
|
5
|
-
|
|
5
|
+
constructor(argv: string[], config: Config);
|
|
6
6
|
}
|
|
7
7
|
export interface PrivateLinkDB {
|
|
8
8
|
apps: {
|
package/lib/base.js
CHANGED
|
@@ -5,8 +5,8 @@ class default_1 extends command_1.Command {
|
|
|
5
5
|
constructor(argv, config) {
|
|
6
6
|
super(argv, config);
|
|
7
7
|
const client = new command_1.APIClient(this.config, {});
|
|
8
|
-
client.defaults.host = process.env.HEROKU_DATA_HOST || '
|
|
9
|
-
client.defaults.headers = Object.assign({}, this.heroku.defaults.headers, { authorization: `Basic ${Buffer.from(':' + this.heroku.auth).toString('base64')}` });
|
|
8
|
+
client.defaults.host = process.env.HEROKU_DATA_HOST || 'api.data.heroku.com';
|
|
9
|
+
client.defaults.headers = Object.assign(Object.assign({}, this.heroku.defaults.headers), { authorization: `Basic ${Buffer.from(':' + this.heroku.auth).toString('base64')}` });
|
|
10
10
|
this.shogun = client;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class
|
|
2
|
+
export default class Add extends BaseCommand {
|
|
4
3
|
static description: string;
|
|
5
|
-
static
|
|
4
|
+
static hiddenAliases: string[];
|
|
6
5
|
static args: {
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
database: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
9
8
|
static flags: {
|
|
10
|
-
'aws-account-id':
|
|
11
|
-
app:
|
|
9
|
+
'aws-account-id': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
static examples: string[];
|
|
14
14
|
run(): Promise<void>;
|
|
@@ -1,42 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const base_1 = require("../../../../base");
|
|
6
6
|
const fetcher_1 = require("../../../../lib/fetcher");
|
|
7
|
-
class
|
|
7
|
+
class Add extends base_1.default {
|
|
8
8
|
async run() {
|
|
9
|
-
const { args, flags } = this.parse(
|
|
10
|
-
const database = await fetcher_1.default(this.heroku, args.database, flags.app);
|
|
11
|
-
const
|
|
9
|
+
const { args, flags } = await this.parse(Add);
|
|
10
|
+
const database = await (0, fetcher_1.default)(this.heroku, args.database, flags.app);
|
|
11
|
+
const { 'aws-account-id': account_ids } = flags;
|
|
12
12
|
const accountFormatted = account_ids.length > 1 ? 'accounts' : 'account';
|
|
13
|
-
|
|
14
|
-
await this.shogun.put(`/private-link/v0/databases/${database}/allowed_accounts`, Object.assign({}, this.shogun.defaults, { body: {
|
|
15
|
-
allowed_accounts: account_ids
|
|
13
|
+
core_1.ux.action.start(`Adding ${accountFormatted}`);
|
|
14
|
+
await this.shogun.put(`/private-link/v0/databases/${database}/allowed_accounts`, Object.assign(Object.assign({}, this.shogun.defaults), { body: {
|
|
15
|
+
allowed_accounts: account_ids,
|
|
16
16
|
} }));
|
|
17
|
-
|
|
17
|
+
core_1.ux.action.stop();
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
exports.default = Add;
|
|
21
|
+
Add.description = 'add one or more allowed AWS accounts to your privatelink endpoint';
|
|
22
|
+
Add.hiddenAliases = ['pg:privatelink:access:add', 'kafka:privatelink:access:add', 'redis:privatelink:access:add'];
|
|
23
|
+
Add.args = {
|
|
24
|
+
database: core_1.Args.string({ required: true }),
|
|
25
|
+
};
|
|
26
|
+
Add.flags = {
|
|
27
|
+
'aws-account-id': command_1.flags.string({
|
|
27
28
|
char: 'i',
|
|
28
29
|
description: 'AWS account id to use',
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
})(),
|
|
36
|
-
app: command_1.flags.app({ required: true })
|
|
30
|
+
required: true,
|
|
31
|
+
multiple: true,
|
|
32
|
+
}),
|
|
33
|
+
app: command_1.flags.app({ required: true }),
|
|
34
|
+
remote: command_1.flags.remote(),
|
|
37
35
|
};
|
|
38
|
-
|
|
39
|
-
'$ heroku data:privatelink:access:add postgresql-sushi-12345 --aws-account-id 123456789012:user/abc',
|
|
40
|
-
'$ heroku data:privatelink:access:add postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --aws-account-id 123456789012:user/xyz',
|
|
36
|
+
Add.examples = [
|
|
37
|
+
'$ heroku data:privatelink:access:add postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --app my-app',
|
|
38
|
+
'$ heroku data:privatelink:access:add postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --aws-account-id 123456789012:user/xyz --app my-app',
|
|
41
39
|
];
|
|
42
|
-
exports.default = EndpointsAccessAdd;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class
|
|
2
|
+
export default class Index extends BaseCommand {
|
|
3
|
+
static topic: string;
|
|
4
4
|
static description: string;
|
|
5
|
-
static
|
|
5
|
+
static hiddenAliases: string[];
|
|
6
6
|
static args: {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
database: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
9
|
static flags: {
|
|
10
|
-
app:
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
12
|
};
|
|
12
13
|
static examples: string[];
|
|
13
14
|
run(): Promise<void>;
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const base_1 = require("../../../../base");
|
|
6
6
|
const fetcher_1 = require("../../../../lib/fetcher");
|
|
7
|
-
class
|
|
7
|
+
class Index extends base_1.default {
|
|
8
8
|
async run() {
|
|
9
|
-
const { args, flags } = this.parse(
|
|
10
|
-
const database = await fetcher_1.default(this.heroku, args.database, flags.app);
|
|
9
|
+
const { args, flags } = await this.parse(Index);
|
|
10
|
+
const database = await (0, fetcher_1.default)(this.heroku, args.database, flags.app);
|
|
11
11
|
const { body: { allowed_accounts } } = await this.shogun.get(`/private-link/v0/databases/${database}`, this.shogun.defaults);
|
|
12
12
|
if (allowed_accounts.length > 0) {
|
|
13
|
-
|
|
13
|
+
core_1.ux.table(allowed_accounts, {
|
|
14
14
|
arn: {
|
|
15
|
-
header: 'ARN'
|
|
15
|
+
header: 'ARN',
|
|
16
16
|
},
|
|
17
17
|
status: {
|
|
18
|
-
header: 'Status'
|
|
19
|
-
}
|
|
18
|
+
header: 'Status',
|
|
19
|
+
},
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
|
|
23
|
+
core_1.ux.log('There are no allowed accounts');
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
exports.default = Index;
|
|
28
|
+
Index.topic = 'data:privatelink:access';
|
|
29
|
+
Index.description = 'list all allowed accounts for your privatelink endpoint';
|
|
30
|
+
Index.hiddenAliases = ['pg:privatelink:access', 'kafka:privatelink:access', 'redis:privatelink:access'];
|
|
31
|
+
Index.args = {
|
|
32
|
+
database: core_1.Args.string({ required: true }),
|
|
33
|
+
};
|
|
34
|
+
Index.flags = {
|
|
35
|
+
app: command_1.flags.app({ required: true }),
|
|
36
|
+
remote: command_1.flags.remote(),
|
|
34
37
|
};
|
|
35
|
-
|
|
36
|
-
'$ heroku data:privatelink:access postgresql-sushi-12345',
|
|
38
|
+
Index.examples = [
|
|
39
|
+
'$ heroku data:privatelink:access postgresql-sushi-12345 --app my-app',
|
|
37
40
|
];
|
|
38
|
-
exports.default = EndpointsAccessIndex;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class
|
|
2
|
+
export default class Remove extends BaseCommand {
|
|
4
3
|
static description: string;
|
|
5
|
-
static
|
|
4
|
+
static hiddenAliases: string[];
|
|
6
5
|
static args: {
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
database: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
9
8
|
static flags: {
|
|
10
|
-
'aws-account-id':
|
|
11
|
-
app:
|
|
9
|
+
'aws-account-id': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
static examples: string[];
|
|
14
14
|
run(): Promise<void>;
|
|
@@ -1,42 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const base_1 = require("../../../../base");
|
|
6
6
|
const fetcher_1 = require("../../../../lib/fetcher");
|
|
7
|
-
class
|
|
7
|
+
class Remove extends base_1.default {
|
|
8
8
|
async run() {
|
|
9
|
-
const { args, flags } = this.parse(
|
|
10
|
-
const database = await fetcher_1.default(this.heroku, args.database, flags.app);
|
|
11
|
-
const
|
|
9
|
+
const { args, flags } = await this.parse(Remove);
|
|
10
|
+
const database = await (0, fetcher_1.default)(this.heroku, args.database, flags.app);
|
|
11
|
+
const { 'aws-account-id': account_ids } = flags;
|
|
12
12
|
const accountFormatted = account_ids.length > 1 ? 'accounts' : 'account';
|
|
13
|
-
|
|
14
|
-
await this.shogun.patch(`/private-link/v0/databases/${database}/allowed_accounts`, Object.assign({}, this.shogun.defaults, { body: {
|
|
15
|
-
allowed_accounts: account_ids
|
|
13
|
+
core_1.ux.action.start(`Removing ${accountFormatted}`);
|
|
14
|
+
await this.shogun.patch(`/private-link/v0/databases/${database}/allowed_accounts`, Object.assign(Object.assign({}, this.shogun.defaults), { body: {
|
|
15
|
+
allowed_accounts: account_ids,
|
|
16
16
|
} }));
|
|
17
|
-
|
|
17
|
+
core_1.ux.action.stop();
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
exports.default = Remove;
|
|
21
|
+
Remove.description = 'remove an allowed account from your privatelink endpoint';
|
|
22
|
+
Remove.hiddenAliases = ['pg:privatelink:access:remove', 'kafka:privatelink:access:remove', 'redis:privatelink:access:remove'];
|
|
23
|
+
Remove.args = {
|
|
24
|
+
database: core_1.Args.string({ required: true }),
|
|
25
|
+
};
|
|
26
|
+
Remove.flags = {
|
|
27
|
+
'aws-account-id': command_1.flags.string({
|
|
27
28
|
char: 'i',
|
|
28
29
|
description: 'AWS account id to use',
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
})(),
|
|
36
|
-
app: command_1.flags.app({ required: true })
|
|
30
|
+
required: true,
|
|
31
|
+
multiple: true,
|
|
32
|
+
}),
|
|
33
|
+
app: command_1.flags.app({ required: true }),
|
|
34
|
+
remote: command_1.flags.remote(),
|
|
37
35
|
};
|
|
38
|
-
|
|
39
|
-
'$ heroku data:privatelink:access:remove postgresql-sushi-12345 --aws-account-id 123456789012:user/xyz',
|
|
40
|
-
'$ heroku data:privatelink:access:remove postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --aws-account-id 123456789012:user/xyz',
|
|
36
|
+
Remove.examples = [
|
|
37
|
+
'$ heroku data:privatelink:access:remove postgresql-sushi-12345 --aws-account-id 123456789012:user/xyz --app my-app',
|
|
38
|
+
'$ heroku data:privatelink:access:remove postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --aws-account-id 123456789012:user/xyz --app my-app',
|
|
41
39
|
];
|
|
42
|
-
exports.default = EndpointsAccessRemove;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../base';
|
|
3
|
-
export default class
|
|
2
|
+
export default class Create extends BaseCommand {
|
|
4
3
|
static description: string;
|
|
5
|
-
static
|
|
4
|
+
static hiddenAliases: string[];
|
|
6
5
|
static args: {
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
database: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
9
8
|
static flags: {
|
|
10
|
-
'aws-account-id':
|
|
11
|
-
app:
|
|
9
|
+
'aws-account-id': import("@oclif/core/lib/interfaces").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
12
|
};
|
|
13
13
|
static examples: string[];
|
|
14
14
|
run(): Promise<void>;
|
|
@@ -2,50 +2,47 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const base_1 = require("../../../base");
|
|
7
7
|
const fetcher_1 = require("../../../lib/fetcher");
|
|
8
|
-
class
|
|
8
|
+
class Create extends base_1.default {
|
|
9
9
|
async run() {
|
|
10
|
-
const { args, flags } = this.parse(
|
|
11
|
-
const database = await fetcher_1.default(this.heroku, args.database, flags.app);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const { body: res } = await this.shogun.post(`/private-link/v0/databases/${database}`, Object.assign({}, this.shogun.defaults, { body: {
|
|
15
|
-
allowed_accounts: account_ids
|
|
10
|
+
const { args, flags } = await this.parse(Create);
|
|
11
|
+
const database = await (0, fetcher_1.default)(this.heroku, args.database, flags.app);
|
|
12
|
+
const { 'aws-account-id': account_ids, app } = flags;
|
|
13
|
+
core_1.ux.action.start('Creating privatelink endpoint');
|
|
14
|
+
const { body: res } = await this.shogun.post(`/private-link/v0/databases/${database}`, Object.assign(Object.assign({}, this.shogun.defaults), { body: {
|
|
15
|
+
allowed_accounts: account_ids,
|
|
16
16
|
} }));
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
core_1.ux.action.stop();
|
|
18
|
+
core_1.ux.log();
|
|
19
|
+
core_1.ux.styledObject({
|
|
20
20
|
Status: res.status,
|
|
21
|
-
'Service Name': res.service_name || 'Provisioning'
|
|
21
|
+
'Service Name': res.service_name || 'Provisioning',
|
|
22
22
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
core_1.ux.log();
|
|
24
|
+
core_1.ux.log(`The privatelink endpoint is now being provisioned for ${color_1.default.green(database)}.`);
|
|
25
|
+
core_1.ux.log('Run ' + color_1.default.cmd('heroku data:privatelink:wait ' + database + ' --app ' + app) +
|
|
26
26
|
' to check the creation process.');
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
exports.default = Create;
|
|
30
|
+
Create.description = 'create a new privatelink endpoint for your database';
|
|
31
|
+
Create.hiddenAliases = ['pg:privatelink:create', 'kafka:privatelink:create', 'redis:privatelink:create'];
|
|
32
|
+
Create.args = {
|
|
33
|
+
database: core_1.Args.string({ required: true }),
|
|
34
|
+
};
|
|
35
|
+
Create.flags = {
|
|
36
|
+
'aws-account-id': command_1.flags.string({
|
|
36
37
|
char: 'i',
|
|
37
38
|
description: 'AWS account id to use',
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
})(),
|
|
45
|
-
app: command_1.flags.app({ required: true })
|
|
39
|
+
required: true,
|
|
40
|
+
multiple: true,
|
|
41
|
+
}),
|
|
42
|
+
app: command_1.flags.app({ required: true }),
|
|
43
|
+
remote: command_1.flags.remote(),
|
|
46
44
|
};
|
|
47
|
-
|
|
48
|
-
'$ heroku data:privatelink:create postgresql-sushi-12345 --aws-account-id 123456789012:user/abc',
|
|
49
|
-
'$ heroku data:privatelink:create postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --account-id 123456789012:user/xyz',
|
|
45
|
+
Create.examples = [
|
|
46
|
+
'$ heroku data:privatelink:create postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --app my-app',
|
|
47
|
+
'$ heroku data:privatelink:create postgresql-sushi-12345 --aws-account-id 123456789012:user/abc --account-id 123456789012:user/xyz --app my-app',
|
|
50
48
|
];
|
|
51
|
-
exports.default = EndpointsCreate;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../base';
|
|
3
|
-
export default class
|
|
2
|
+
export default class Destroy extends BaseCommand {
|
|
4
3
|
static description: string;
|
|
5
|
-
static
|
|
4
|
+
static hiddenAliases: string[];
|
|
6
5
|
static args: {
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
database: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
9
8
|
static flags: {
|
|
10
|
-
app:
|
|
9
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
static examples: string[];
|
|
13
13
|
run(): Promise<void>;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const base_1 = require("../../../base");
|
|
6
6
|
const fetcher_1 = require("../../../lib/fetcher");
|
|
7
|
-
class
|
|
7
|
+
class Destroy extends base_1.default {
|
|
8
8
|
async run() {
|
|
9
|
-
const { args, flags } = this.parse(
|
|
10
|
-
const database = await fetcher_1.default(this.heroku, args.database, flags.app);
|
|
11
|
-
|
|
9
|
+
const { args, flags } = await this.parse(Destroy);
|
|
10
|
+
const database = await (0, fetcher_1.default)(this.heroku, args.database, flags.app);
|
|
11
|
+
core_1.ux.action.start('Destroying privatelink endpoint');
|
|
12
12
|
await this.shogun.delete(`/private-link/v0/databases/${database}`, this.shogun.defaults);
|
|
13
|
-
|
|
13
|
+
core_1.ux.action.stop();
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
exports.default = Destroy;
|
|
17
|
+
Destroy.description = 'destroy a privatelink endpoint for your database';
|
|
18
|
+
Destroy.hiddenAliases = ['pg:privatelink:destroy', 'kafka:privatelink:destroy', 'redis:privatelink:destroy'];
|
|
19
|
+
Destroy.args = {
|
|
20
|
+
database: core_1.Args.string({ required: true }),
|
|
21
|
+
};
|
|
22
|
+
Destroy.flags = {
|
|
23
|
+
app: command_1.flags.app({ required: true }),
|
|
24
|
+
remote: command_1.flags.remote(),
|
|
23
25
|
};
|
|
24
|
-
|
|
25
|
-
'$ heroku data:privatelink:destroy postgresql-sushi-12345',
|
|
26
|
+
Destroy.examples = [
|
|
27
|
+
'$ heroku data:privatelink:destroy postgresql-sushi-12345 --app my-app',
|
|
26
28
|
];
|
|
27
|
-
exports.default = EndpointsDestroy;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../base';
|
|
3
|
-
export default class
|
|
2
|
+
export default class Index extends BaseCommand {
|
|
3
|
+
static topic: string;
|
|
4
4
|
static description: string;
|
|
5
|
-
static
|
|
5
|
+
static hiddenAliases: string[];
|
|
6
6
|
static args: {
|
|
7
|
-
|
|
8
|
-
}
|
|
7
|
+
database: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
9
|
static flags: {
|
|
10
|
-
app:
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
12
|
};
|
|
12
13
|
static examples: string[];
|
|
13
14
|
run(): Promise<void>;
|
|
15
|
+
private addonType;
|
|
14
16
|
}
|
|
@@ -2,60 +2,70 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const base_1 = require("../../../base");
|
|
7
|
-
const addontype_1 = require("../../../lib/addontype");
|
|
8
7
|
const fetcher_1 = require("../../../lib/fetcher");
|
|
9
|
-
class
|
|
8
|
+
class Index extends base_1.default {
|
|
10
9
|
async run() {
|
|
11
|
-
const { args, flags } = this.parse(
|
|
12
|
-
const
|
|
10
|
+
const { args, flags } = await this.parse(Index);
|
|
11
|
+
const { app } = flags;
|
|
12
|
+
const database = await (0, fetcher_1.default)(this.heroku, args.database, app);
|
|
13
13
|
const { body: res } = await this.shogun.get(`/private-link/v0/databases/${database}`, this.shogun.defaults);
|
|
14
|
-
const addonType =
|
|
14
|
+
const addonType = this.addonType(res.addon.name);
|
|
15
15
|
if (res.status === 'Provisioning') {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
core_1.ux.log();
|
|
17
|
+
core_1.ux.log(`The privatelink endpoint is now being provisioned for ${color_1.default.green(database)}.`);
|
|
18
|
+
core_1.ux.log(`Run ${color_1.default.cmd(`heroku data:privatelink:wait -a ${app}`)} to check the creation process.`);
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
core_1.ux.styledHeader(`privatelink endpoint status for ${color_1.default.green(database)}`);
|
|
22
|
+
core_1.ux.styledObject({
|
|
23
23
|
Status: res.status,
|
|
24
24
|
'Service Name': res.service_name || 'Provisioning',
|
|
25
25
|
});
|
|
26
26
|
if (res && res.allowed_accounts.length > 0) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
core_1.ux.log();
|
|
28
|
+
core_1.ux.styledHeader('Allowed Accounts');
|
|
29
|
+
core_1.ux.table(res.allowed_accounts, {
|
|
30
30
|
arn: { header: 'ARN' },
|
|
31
|
-
status: {}
|
|
31
|
+
status: {},
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
core_1.ux.log();
|
|
35
35
|
if (res && res.connections.length > 0) {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
core_1.ux.styledHeader('Connections');
|
|
37
|
+
core_1.ux.table(res.connections, {
|
|
38
38
|
endpoint_id: { header: 'Endpoint ID' },
|
|
39
39
|
owner_arn: { header: 'Owner ARN' },
|
|
40
|
-
status: {}
|
|
40
|
+
status: {},
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
else if (res.status === 'Operational' && res.connections.length === 0) {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
core_1.ux.log('Your privatelink endpoint is now operational.');
|
|
45
|
+
core_1.ux.log(`You must now copy the ${color_1.default.green('Service Name')} and follow the rest of the steps listed in https://devcenter.heroku.com/articles/heroku-${addonType}-via-privatelink`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
addonType(addon_name) {
|
|
50
|
+
if (addon_name.includes('postgres'))
|
|
51
|
+
return 'postgres';
|
|
52
|
+
if (addon_name.includes('kafka'))
|
|
53
|
+
return 'kafka';
|
|
54
|
+
if (addon_name.includes('redis'))
|
|
55
|
+
return 'redis';
|
|
56
|
+
}
|
|
49
57
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
exports.default = Index;
|
|
59
|
+
Index.topic = 'data:privatelink';
|
|
60
|
+
Index.description = 'list all your privatelink endpoints';
|
|
61
|
+
Index.hiddenAliases = ['pg:privatelink', 'kafka:privatelink', 'redis:privatelink'];
|
|
62
|
+
Index.args = {
|
|
63
|
+
database: core_1.Args.string({ required: true }),
|
|
64
|
+
};
|
|
65
|
+
Index.flags = {
|
|
66
|
+
app: command_1.flags.app({ required: true }),
|
|
67
|
+
remote: command_1.flags.remote(),
|
|
57
68
|
};
|
|
58
|
-
|
|
59
|
-
'$ heroku data:privatelink postgresql-sushi-12345',
|
|
69
|
+
Index.examples = [
|
|
70
|
+
'$ heroku data:privatelink postgresql-sushi-12345 --app my-app',
|
|
60
71
|
];
|
|
61
|
-
exports.default = EndpointsIndex;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../base';
|
|
3
|
-
export default class
|
|
2
|
+
export default class Wait extends BaseCommand {
|
|
4
3
|
static description: string;
|
|
5
|
-
static
|
|
4
|
+
static hiddenAliases: string[];
|
|
6
5
|
static args: {
|
|
7
|
-
|
|
8
|
-
}
|
|
6
|
+
database: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
9
8
|
static flags: {
|
|
10
|
-
app:
|
|
9
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
static examples: string[];
|
|
13
13
|
run(): Promise<void>;
|