-
Notifications
You must be signed in to change notification settings - Fork 228
/
Copy pathinfo.ts
25 lines (22 loc) · 917 Bytes
/
info.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import {Command} from '@heroku-cli/command'
import {Args} from '@oclif/core'
import {TelemetryDrain} from '../../lib/types/telemetry'
import {displayTelemetryDrain} from '../../lib/telemetry/util'
export default class Info extends Command {
static topic = 'telemetry'
static description = 'show a telemetry drain\'s info'
static args = {
telemetry_drain_id: Args.string({required: true, description: 'ID of the drain to show info for'}),
}
static example = '$ heroku telemetry:info 022e2e2e-2e2e-2e2e-2e2e-2e2e2e2e2e2e'
public async run(): Promise<void> {
const {args} = await this.parse(Info)
const {telemetry_drain_id} = args
const {body: telemetryDrain} = await this.heroku.get<TelemetryDrain>(`/telemetry-drains/${telemetry_drain_id}`, {
headers: {
Accept: 'application/vnd.heroku+json; version=3.sdk',
},
})
displayTelemetryDrain(telemetryDrain)
}
}