/
influxdb.go
47 lines (42 loc) · 1.34 KB
/
influxdb.go
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package cmd
import (
"github.com/Scalingo/cli/appdetect"
"github.com/Scalingo/cli/cmd/autocomplete"
"github.com/Scalingo/cli/db"
"github.com/urfave/cli"
)
var (
InfluxDBConsoleCommand = cli.Command{
Name: "influxdb-console",
Category: "Databases",
Usage: "Run an interactive console with your InfluxDB addon",
Flags: []cli.Flag{appFlag,
cli.StringFlag{Name: "size, s", Value: "", Usage: "Size of the container"},
},
Description: ` Run an interactive console with your InfluxDB addon.
Examples
scalingo --app myapp influxdb-console
scalingo --app myapp influxdb-console --size L
The --size flag makes it easy to specify the size of the container executing
the InfluxDB console. Each container size has different price and performance.
You can read more about container sizes here:
http://doc.scalingo.com/internals/container-sizes.html
# See also 'mongo-console' and 'mysql-console'
`,
Action: func(c *cli.Context) {
currentApp := appdetect.CurrentApp(c)
opts := db.InfluxDBConsoleOpts{
App: currentApp,
Size: c.String("s"),
}
if len(c.Args()) != 0 {
cli.ShowCommandHelp(c, "influxdb-console")
} else if err := db.InfluxDBConsole(opts); err != nil {
errorQuit(err)
}
},
BashComplete: func(c *cli.Context) {
autocomplete.CmdFlagsAutoComplete(c, "influxdb-console")
},
}
)