heroku 10.0.0-alpha.0 → 10.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/logs.d.ts +2 -2
- package/lib/commands/logs.js +9 -7
- package/lib/commands/ps/restart.d.ts +2 -1
- package/lib/commands/ps/restart.js +43 -11
- package/lib/commands/ps/stop.d.ts +3 -2
- package/lib/commands/ps/stop.js +40 -9
- package/lib/commands/ps/type.js +2 -1
- package/lib/commands/spaces/create.d.ts +1 -0
- package/lib/commands/spaces/create.js +4 -2
- package/lib/commands/telemetry/add.d.ts +0 -1
- package/lib/commands/telemetry/add.js +21 -31
- package/lib/commands/telemetry/index.d.ts +1 -1
- package/lib/commands/telemetry/index.js +16 -10
- package/lib/commands/telemetry/remove.js +2 -2
- package/lib/hooks/plugins/preinstall/disclaimers.d.ts +3 -0
- package/lib/hooks/plugins/preinstall/disclaimers.js +26 -0
- package/lib/lib/run/log-displayer.js +6 -2
- package/oclif.manifest.json +733 -683
- package/package.json +5 -2
package/lib/commands/logs.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export default class Logs extends Command {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
-
dyno: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
'dyno-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
'force-colors': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
'no-color': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
num: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -12,7 +12,7 @@ export default class Logs extends Command {
|
|
|
12
12
|
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
13
|
source: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
14
|
tail: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
'process-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
16
|
};
|
|
17
17
|
run(): Promise<void>;
|
|
18
18
|
}
|
package/lib/commands/logs.js
CHANGED
|
@@ -8,7 +8,7 @@ const tsheredoc_1 = require("tsheredoc");
|
|
|
8
8
|
class Logs extends command_1.Command {
|
|
9
9
|
async run() {
|
|
10
10
|
const { flags } = await this.parse(Logs);
|
|
11
|
-
const { app, dyno, 'force-colors': forceColors, num, ps, source, tail, type } = flags;
|
|
11
|
+
const { app, 'dyno-name': dyno, 'force-colors': forceColors, num, ps, source, tail, 'process-type': type } = flags;
|
|
12
12
|
if (forceColors)
|
|
13
13
|
color_1.default.enabled = true;
|
|
14
14
|
await (0, log_displayer_1.default)(this.heroku, {
|
|
@@ -29,13 +29,14 @@ Logs.description = (0, tsheredoc_1.default) `
|
|
|
29
29
|
Logs.examples = [
|
|
30
30
|
'heroku logs --app=my-app',
|
|
31
31
|
'heroku logs --num=50 --app=my-app',
|
|
32
|
-
'heroku logs --dyno=web-123-456 --app=my-app',
|
|
33
|
-
'heroku logs --type=web --app=my-app',
|
|
32
|
+
'heroku logs --dyno-name=web-123-456 --app=my-app',
|
|
33
|
+
'heroku logs --process-type=web --app=my-app',
|
|
34
34
|
'heroku logs --app=my-app --tail',
|
|
35
35
|
];
|
|
36
36
|
Logs.flags = {
|
|
37
37
|
app: command_1.flags.app({ required: true }),
|
|
38
|
-
dyno: command_1.flags.string({
|
|
38
|
+
'dyno-name': command_1.flags.string({
|
|
39
|
+
aliases: ['dyno'],
|
|
39
40
|
char: 'd',
|
|
40
41
|
description: 'only show output from this dyno (such as "web-123-456" or "worker.2")',
|
|
41
42
|
}),
|
|
@@ -60,7 +61,7 @@ Logs.flags = {
|
|
|
60
61
|
hidden: true,
|
|
61
62
|
description: 'hidden alias for type',
|
|
62
63
|
relationships: [
|
|
63
|
-
{ type: 'none', flags: ['dyno'] },
|
|
64
|
+
{ type: 'none', flags: ['dyno-name'] },
|
|
64
65
|
],
|
|
65
66
|
completion: completions_1.ProcessTypeCompletion,
|
|
66
67
|
}),
|
|
@@ -74,10 +75,11 @@ Logs.flags = {
|
|
|
74
75
|
default: false,
|
|
75
76
|
description: 'continually stream logs (defaults to true for Fir generation apps)',
|
|
76
77
|
}),
|
|
77
|
-
type: command_1.flags.string({
|
|
78
|
+
'process-type': command_1.flags.string({
|
|
79
|
+
char: 'p',
|
|
78
80
|
description: 'only show output from this process type (such as "web" or "worker")',
|
|
79
81
|
relationships: [
|
|
80
|
-
{ type: 'none', flags: ['dyno', 'ps'] },
|
|
82
|
+
{ type: 'none', flags: ['dyno-name', 'ps'] },
|
|
81
83
|
],
|
|
82
84
|
completion: completions_1.ProcessTypeCompletion,
|
|
83
85
|
}),
|
|
@@ -5,13 +5,14 @@ export default class Restart extends Command {
|
|
|
5
5
|
static aliases: string[];
|
|
6
6
|
static hiddenAliases: string[];
|
|
7
7
|
static examples: string[];
|
|
8
|
-
static help: string;
|
|
9
8
|
static args: {
|
|
10
9
|
dyno: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
11
10
|
};
|
|
12
11
|
static flags: {
|
|
13
12
|
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
13
|
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
'dyno-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
'process-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
16
|
};
|
|
16
17
|
run(): Promise<void>;
|
|
17
18
|
}
|
|
@@ -3,36 +3,68 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const color_1 = require("@heroku-cli/color");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const completions_1 = require("@heroku-cli/command/lib/completions");
|
|
7
|
+
const tsheredoc_1 = require("tsheredoc");
|
|
6
8
|
class Restart extends command_1.Command {
|
|
7
9
|
async run() {
|
|
8
10
|
const { args, flags } = await this.parse(Restart);
|
|
9
11
|
const app = flags.app;
|
|
10
|
-
const dyno = args.dyno;
|
|
12
|
+
const dyno = flags['dyno-name'] || args.dyno;
|
|
13
|
+
const type = flags['process-type'];
|
|
11
14
|
let msg = 'Restarting';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
let restartUrl;
|
|
16
|
+
if (type) {
|
|
17
|
+
msg += ` all ${color_1.default.cyan(type)} dynos`;
|
|
18
|
+
restartUrl = `/apps/${app}/formations/${encodeURIComponent(type)}`;
|
|
19
|
+
}
|
|
20
|
+
else if (dyno) {
|
|
21
|
+
if (args.dyno) {
|
|
22
|
+
core_1.ux.warn(`DYNO is a deprecated argument. Use ${color_1.default.cmd('--dyno-name')} or ${color_1.default.cmd('--process-type')} instead.`);
|
|
23
|
+
}
|
|
24
|
+
msg += ` dyno ${color_1.default.cyan(dyno)}`;
|
|
25
|
+
restartUrl = `/apps/${app}/dynos/${encodeURIComponent(dyno)}`;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
msg += ' all dynos';
|
|
29
|
+
restartUrl = `/apps/${app}/dynos`;
|
|
30
|
+
}
|
|
15
31
|
msg += ` on ${color_1.default.app(app)}`;
|
|
16
32
|
core_1.ux.action.start(msg);
|
|
17
|
-
await this.heroku.delete(
|
|
33
|
+
await this.heroku.delete(restartUrl, {
|
|
34
|
+
headers: {
|
|
35
|
+
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
18
38
|
core_1.ux.action.stop();
|
|
19
39
|
}
|
|
20
40
|
}
|
|
21
41
|
exports.default = Restart;
|
|
22
|
-
Restart.description =
|
|
42
|
+
Restart.description = (0, tsheredoc_1.default)(`
|
|
43
|
+
restart an app dyno or process type
|
|
44
|
+
if neither --dyno nor --type are specified, restarts all dynos on app
|
|
45
|
+
`);
|
|
23
46
|
Restart.topic = 'ps';
|
|
24
47
|
Restart.aliases = ['dyno:restart'];
|
|
25
48
|
Restart.hiddenAliases = ['restart'];
|
|
26
49
|
Restart.examples = [
|
|
27
|
-
'$ heroku ps:restart web.1',
|
|
28
|
-
'$ heroku ps:restart web',
|
|
29
|
-
'$ heroku ps:restart',
|
|
50
|
+
'$ heroku ps:restart --app myapp --dyno-name web.1',
|
|
51
|
+
'$ heroku ps:restart --app myapp --process-type web',
|
|
52
|
+
'$ heroku ps:restart --app myapp',
|
|
30
53
|
];
|
|
31
|
-
Restart.help = 'if DYNO is not specified, restarts all dynos on app';
|
|
32
54
|
Restart.args = {
|
|
33
|
-
dyno: core_1.Args.string({ required: false }),
|
|
55
|
+
dyno: core_1.Args.string({ description: 'name of the dyno to restart', required: false, deprecated: true }),
|
|
34
56
|
};
|
|
35
57
|
Restart.flags = {
|
|
36
58
|
app: command_1.flags.app({ required: true }),
|
|
37
59
|
remote: command_1.flags.remote(),
|
|
60
|
+
'dyno-name': command_1.flags.string({
|
|
61
|
+
char: 'd',
|
|
62
|
+
description: 'name of the dyno to restart',
|
|
63
|
+
}),
|
|
64
|
+
'process-type': command_1.flags.string({
|
|
65
|
+
char: 'p',
|
|
66
|
+
description: 'name of the process type to restart',
|
|
67
|
+
completion: completions_1.ProcessTypeCompletion,
|
|
68
|
+
exclusive: ['dyno-name'],
|
|
69
|
+
}),
|
|
38
70
|
};
|
|
@@ -5,13 +5,14 @@ export default class Stop extends Command {
|
|
|
5
5
|
static aliases: string[];
|
|
6
6
|
static hiddenAliases: string[];
|
|
7
7
|
static examples: string[];
|
|
8
|
-
static help: string;
|
|
9
8
|
static args: {
|
|
10
|
-
dyno: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
9
|
+
dyno: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
11
10
|
};
|
|
12
11
|
static flags: {
|
|
13
12
|
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
13
|
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
'dyno-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
'process-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
16
|
};
|
|
16
17
|
run(): Promise<void>;
|
|
17
18
|
}
|
package/lib/commands/ps/stop.js
CHANGED
|
@@ -3,31 +3,62 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const color_1 = require("@heroku-cli/color");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const completions_1 = require("@heroku-cli/command/lib/completions");
|
|
7
|
+
const tsheredoc_1 = require("tsheredoc");
|
|
6
8
|
class Stop extends command_1.Command {
|
|
7
9
|
async run() {
|
|
8
10
|
const { args, flags } = await this.parse(Stop);
|
|
9
11
|
const app = flags.app;
|
|
10
|
-
const dyno = args.dyno;
|
|
11
|
-
const type =
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const dyno = flags['dyno-name'] || args.dyno;
|
|
13
|
+
const type = flags['process-type'];
|
|
14
|
+
let msg = 'Stopping';
|
|
15
|
+
let stopUrl = '';
|
|
16
|
+
if (type) {
|
|
17
|
+
msg += ` all ${color_1.default.cyan(type)} dynos`;
|
|
18
|
+
stopUrl = `/apps/${app}/formations/${encodeURIComponent(type)}/actions/stop`;
|
|
19
|
+
}
|
|
20
|
+
else if (dyno) {
|
|
21
|
+
if (args.dyno) {
|
|
22
|
+
core_1.ux.warn(`DYNO is a deprecated argument. Use ${color_1.default.cmd('--dyno-name')} or ${color_1.default.cmd('--process-type')} instead.`);
|
|
23
|
+
}
|
|
24
|
+
msg += ` dyno ${color_1.default.cyan(dyno)}`;
|
|
25
|
+
stopUrl = `/apps/${app}/dynos/${encodeURIComponent(dyno)}/actions/stop`;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
core_1.ux.error((0, tsheredoc_1.default)(`
|
|
29
|
+
Please specify a process type or dyno name to stop.
|
|
30
|
+
See more help with --help
|
|
31
|
+
`));
|
|
32
|
+
}
|
|
33
|
+
msg += ` on ${color_1.default.app(app)}`;
|
|
34
|
+
core_1.ux.action.start(msg);
|
|
35
|
+
await this.heroku.post(stopUrl, { headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' } });
|
|
14
36
|
core_1.ux.action.stop();
|
|
15
37
|
}
|
|
16
38
|
}
|
|
17
39
|
exports.default = Stop;
|
|
18
|
-
Stop.description = 'stop app dyno';
|
|
40
|
+
Stop.description = 'stop an app dyno or process type';
|
|
19
41
|
Stop.topic = 'ps';
|
|
20
42
|
Stop.aliases = ['dyno:stop', 'ps:kill', 'dyno:kill'];
|
|
21
43
|
Stop.hiddenAliases = ['stop', 'kill'];
|
|
22
44
|
Stop.examples = [
|
|
23
|
-
'$ heroku ps:stop run.1828',
|
|
24
|
-
'$ heroku ps:stop run',
|
|
45
|
+
'$ heroku ps:stop --app myapp --dyno-name run.1828',
|
|
46
|
+
'$ heroku ps:stop --app myapp --process-type run',
|
|
25
47
|
];
|
|
26
|
-
Stop.help = 'stop app dyno or dyno type';
|
|
27
48
|
Stop.args = {
|
|
28
|
-
dyno: core_1.Args.string({ required: true }),
|
|
49
|
+
dyno: core_1.Args.string({ description: 'name of the dyno to stop', required: false, deprecated: true }),
|
|
29
50
|
};
|
|
30
51
|
Stop.flags = {
|
|
31
52
|
app: command_1.flags.app({ required: true }),
|
|
32
53
|
remote: command_1.flags.remote(),
|
|
54
|
+
'dyno-name': command_1.flags.string({
|
|
55
|
+
char: 'd',
|
|
56
|
+
description: 'name of the dyno to stop',
|
|
57
|
+
}),
|
|
58
|
+
'process-type': command_1.flags.string({
|
|
59
|
+
char: 'p',
|
|
60
|
+
description: 'name of the process type to stop',
|
|
61
|
+
completion: completions_1.ProcessTypeCompletion,
|
|
62
|
+
exclusive: ['dyno-name'],
|
|
63
|
+
}),
|
|
33
64
|
};
|
package/lib/commands/ps/type.js
CHANGED
|
@@ -72,7 +72,7 @@ const displayFormation = async (heroku, app) => {
|
|
|
72
72
|
if (formation.length === 0) {
|
|
73
73
|
throw emptyFormationErr(app);
|
|
74
74
|
}
|
|
75
|
-
core_1.ux.styledHeader('
|
|
75
|
+
core_1.ux.styledHeader('Process Types');
|
|
76
76
|
core_1.ux.table(formationTableData, {
|
|
77
77
|
type: {},
|
|
78
78
|
size: {},
|
|
@@ -80,6 +80,7 @@ const displayFormation = async (heroku, app) => {
|
|
|
80
80
|
'cost/hour': {},
|
|
81
81
|
'max cost/month': {},
|
|
82
82
|
});
|
|
83
|
+
core_1.ux.log();
|
|
83
84
|
core_1.ux.styledHeader('Dyno Totals');
|
|
84
85
|
core_1.ux.table(dynoTotalsTableData, {
|
|
85
86
|
type: {},
|
|
@@ -7,6 +7,7 @@ export default class Create extends Command {
|
|
|
7
7
|
channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
cidr: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
9
|
'data-cidr': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
features: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
generation: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
12
|
'kpi-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
13
|
'log-drain-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const tsheredoc_1 = require("tsheredoc");
|
|
7
7
|
const spaces_1 = require("../../lib/spaces/spaces");
|
|
8
8
|
const completions_1 = require("../../lib/autocomplete/completions");
|
|
9
|
+
const parsers_1 = require("../../lib/spaces/parsers");
|
|
9
10
|
class Create extends command_1.Command {
|
|
10
11
|
async run() {
|
|
11
12
|
const { flags, args } = await this.parse(Create);
|
|
@@ -29,7 +30,7 @@ class Create extends command_1.Command {
|
|
|
29
30
|
channel_name: channel,
|
|
30
31
|
cidr,
|
|
31
32
|
data_cidr: dataCidr,
|
|
32
|
-
|
|
33
|
+
features: (0, parsers_1.splitCsv)(features),
|
|
33
34
|
generation,
|
|
34
35
|
kpi_url: kpiUrl,
|
|
35
36
|
log_drain_url: logDrainUrl,
|
|
@@ -65,13 +66,14 @@ Create.examples = [(0, tsheredoc_1.default) `
|
|
|
65
66
|
CIDR: 10.0.0.0/16
|
|
66
67
|
Data CIDR: 172.23.0.0/20
|
|
67
68
|
State: allocating
|
|
69
|
+
Generation: fir
|
|
68
70
|
Created at: 2016-01-06T03:23:13Z
|
|
69
71
|
`];
|
|
70
72
|
Create.flags = {
|
|
71
73
|
channel: command_1.flags.string({ hidden: true }),
|
|
72
74
|
cidr: command_1.flags.string({ description: 'RFC-1918 CIDR the space will use' }),
|
|
73
75
|
'data-cidr': command_1.flags.string({ description: 'RFC-1918 CIDR used by Heroku Data resources for the space' }),
|
|
74
|
-
|
|
76
|
+
features: command_1.flags.string({ hidden: true, description: 'a list of features separated by commas' }),
|
|
75
77
|
generation: command_1.flags.string({ description: 'generation for space', default: 'cedar', options: ['cedar', 'fir'] }),
|
|
76
78
|
'kpi-url': command_1.flags.string({ hidden: true, description: 'self-managed KPI endpoint to use' }),
|
|
77
79
|
'log-drain-url': command_1.flags.string({ hidden: true, description: 'direct log drain url' }),
|
|
@@ -5,24 +5,25 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const tsheredoc_1 = require("tsheredoc");
|
|
6
6
|
const util_1 = require("../../lib/telemetry/util");
|
|
7
7
|
class Add extends command_1.Command {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.getTypeAndName = function (app, space) {
|
|
11
|
-
if (app) {
|
|
12
|
-
return { type: 'app', name: app };
|
|
13
|
-
}
|
|
14
|
-
return { type: 'space', name: space };
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
8
|
async run() {
|
|
18
9
|
const { flags, args } = await this.parse(Add);
|
|
19
10
|
const { app, space, signals, endpoint, transport } = flags;
|
|
20
11
|
const { headers } = args;
|
|
21
|
-
|
|
12
|
+
let id;
|
|
13
|
+
if (app) {
|
|
14
|
+
const { body: herokuApp } = await this.heroku.get(`/apps/${app}`, {
|
|
15
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' },
|
|
16
|
+
});
|
|
17
|
+
id = herokuApp.id;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const { body: herokuSpace } = await this.heroku.get(`/spaces/${space}`);
|
|
21
|
+
id = herokuSpace.id;
|
|
22
|
+
}
|
|
22
23
|
const drainConfig = {
|
|
23
24
|
owner: {
|
|
24
|
-
type:
|
|
25
|
-
id
|
|
25
|
+
type: app ? 'app' : 'space',
|
|
26
|
+
id,
|
|
26
27
|
},
|
|
27
28
|
signals: (0, util_1.validateAndFormatSignals)(signals),
|
|
28
29
|
exporter: {
|
|
@@ -31,24 +32,13 @@ class Add extends command_1.Command {
|
|
|
31
32
|
headers: JSON.parse(headers),
|
|
32
33
|
},
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
core_1.ux.log(`successfully added drain ${drain.exporter.endpoint}`);
|
|
42
|
-
}
|
|
43
|
-
else if (space) {
|
|
44
|
-
const { body: drain } = await this.heroku.post(`/spaces/${space}/telemetry-drains`, {
|
|
45
|
-
body: drainConfig,
|
|
46
|
-
headers: {
|
|
47
|
-
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
core_1.ux.log(`successfully added drain ${drain.exporter.endpoint}`);
|
|
51
|
-
}
|
|
35
|
+
const { body: drain } = await this.heroku.post('/telemetry-drains', {
|
|
36
|
+
body: drainConfig,
|
|
37
|
+
headers: {
|
|
38
|
+
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
core_1.ux.log(`successfully added drain ${drain.exporter.endpoint}`);
|
|
52
42
|
}
|
|
53
43
|
}
|
|
54
44
|
exports.default = Add;
|
|
@@ -66,5 +56,5 @@ Add.args = {
|
|
|
66
56
|
};
|
|
67
57
|
Add.example = (0, tsheredoc_1.default)(`
|
|
68
58
|
Add a telemetry drain to an app to collect logs and traces:
|
|
69
|
-
$ heroku telemetry:add --signals logs,traces --endpoint https://my-endpoint.com --transport http 'x-drain-example-team: API_KEY x-drain-example-dataset: METRICS_DATASET'
|
|
59
|
+
$ heroku telemetry:add --app myapp --signals logs,traces --endpoint https://my-endpoint.com --transport http '{"x-drain-example-team": "API_KEY", "x-drain-example-dataset": "METRICS_DATASET"}'
|
|
70
60
|
`);
|
|
@@ -9,5 +9,5 @@ export default class Index extends Command {
|
|
|
9
9
|
};
|
|
10
10
|
static example: string;
|
|
11
11
|
run(): Promise<void>;
|
|
12
|
-
protected display(telemetryDrains: TelemetryDrains,
|
|
12
|
+
protected display(telemetryDrains: TelemetryDrains, owner: string | undefined): void;
|
|
13
13
|
}
|
|
@@ -6,13 +6,14 @@ class Index extends command_1.Command {
|
|
|
6
6
|
async run() {
|
|
7
7
|
const { flags } = await this.parse(Index);
|
|
8
8
|
const { app, space } = flags;
|
|
9
|
+
let drains = [];
|
|
9
10
|
if (app) {
|
|
10
11
|
const { body: appTelemetryDrains } = await this.heroku.get(`/apps/${app}/telemetry-drains`, {
|
|
11
12
|
headers: {
|
|
12
13
|
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
13
14
|
},
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
+
drains = appTelemetryDrains;
|
|
16
17
|
}
|
|
17
18
|
else if (space) {
|
|
18
19
|
const { body: spaceTelemetryDrains } = await this.heroku.get(`/spaces/${space}/telemetry-drains`, {
|
|
@@ -20,17 +21,22 @@ class Index extends command_1.Command {
|
|
|
20
21
|
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
|
-
|
|
24
|
+
drains = spaceTelemetryDrains;
|
|
24
25
|
}
|
|
26
|
+
this.display(drains, app || space);
|
|
25
27
|
}
|
|
26
|
-
display(telemetryDrains,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
display(telemetryDrains, owner) {
|
|
29
|
+
if (telemetryDrains.length === 0) {
|
|
30
|
+
core_1.ux.log(`There are no telemetry drains in ${owner}`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
core_1.ux.styledHeader(`${owner} Telemetry Drains`);
|
|
34
|
+
core_1.ux.table(telemetryDrains, {
|
|
35
|
+
ID: { get: telemetryDrain => telemetryDrain.id },
|
|
36
|
+
Signals: { get: telemetryDrain => telemetryDrain.signals },
|
|
37
|
+
Endpoint: { get: telemetryDrain => telemetryDrain.exporter.endpoint },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
42
|
exports.default = Index;
|
|
@@ -15,8 +15,8 @@ class Remove extends command_1.Command {
|
|
|
15
15
|
`));
|
|
16
16
|
}
|
|
17
17
|
if (telemetry_drain_id) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
core_1.ux.action.start(`Removing telemetry drain ${telemetry_drain_id}`);
|
|
19
|
+
await this.removeDrain(telemetry_drain_id);
|
|
20
20
|
}
|
|
21
21
|
else if (app) {
|
|
22
22
|
core_1.ux.action.start(`Removing all telemetry drains from app ${app}`);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const hook = async function (options) {
|
|
5
|
+
const npmPackageNames = ['@heroku/plugin-ai', '@heroku-cli/plugin-ai'];
|
|
6
|
+
if (options.plugin.type !== 'npm' || !npmPackageNames.includes(options.plugin.name))
|
|
7
|
+
return;
|
|
8
|
+
core_1.ux.warn('\n\nThis pilot feature is a Beta Service. You may opt to try such Beta Service in your sole discretion. ' +
|
|
9
|
+
'Any use of the Beta Service is subject to the applicable Beta Services Terms provided at ' +
|
|
10
|
+
'https://www.salesforce.com/company/legal/customer-agreements/. While use of the pilot feature itself is free, ' +
|
|
11
|
+
'to the extent such use consumes a generally available Service, you may be charged for that consumption as set ' +
|
|
12
|
+
'forth in the Documentation. Your continued use of this pilot feature constitutes your acceptance of the foregoing.\n\n' +
|
|
13
|
+
'For clarity and without limitation, the various third-party machine learning and generative artificial intelligence ' +
|
|
14
|
+
'(AI) models and applications (each a “Platform”) integrated with the Beta Service are Non-SFDC Applications, ' +
|
|
15
|
+
'as that term is defined in the Beta Services Terms. Note that these third-party Platforms include features that use ' +
|
|
16
|
+
'generative AI technology. Due to the nature of generative AI, the output that a Platform generates may be ' +
|
|
17
|
+
'unpredictable, and may include inaccurate or harmful responses. Before using any generative AI output, Customer is ' +
|
|
18
|
+
'solely responsible for reviewing the output for accuracy, safety, and compliance with applicable laws and third-party ' +
|
|
19
|
+
'acceptable use policies. In addition, Customer’s use of each Platform may be subject to the Platform’s own terms and ' +
|
|
20
|
+
'conditions, compliance with which Customer is solely responsible.\n');
|
|
21
|
+
const response = await core_1.ux.prompt('Continue? (Y/N)');
|
|
22
|
+
if (response.toUpperCase() !== 'Y') {
|
|
23
|
+
core_1.ux.error('Canceled', { exit: 1 });
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.default = hook;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
+
const color_1 = require("@heroku-cli/color");
|
|
4
5
|
const colorize_1 = require("./colorize");
|
|
5
6
|
const generation_1 = require("../apps/generation");
|
|
6
7
|
const EventSource = require('@heroku/eventsource');
|
|
@@ -55,17 +56,20 @@ async function logDisplayer(heroku, options) {
|
|
|
55
56
|
const requestBodyParameters = {
|
|
56
57
|
source: options.source,
|
|
57
58
|
};
|
|
58
|
-
if (firApp)
|
|
59
|
+
if (firApp) {
|
|
60
|
+
process.stderr.write(color_1.default.cyan.bold('Fetching logs...\n\n'));
|
|
59
61
|
Object.assign(requestBodyParameters, {
|
|
60
62
|
dyno: options.dyno,
|
|
61
63
|
type: options.type,
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
64
67
|
Object.assign(requestBodyParameters, {
|
|
65
68
|
dyno: options.dyno || options.type,
|
|
66
69
|
lines: options.lines,
|
|
67
70
|
tail: options.tail,
|
|
68
71
|
});
|
|
72
|
+
}
|
|
69
73
|
let recreateLogSession = false;
|
|
70
74
|
do {
|
|
71
75
|
const { body: logSession } = await heroku.post(`/apps/${options.app}/log-sessions`, {
|