Files
influx-cli/cmd/influx/replication.go
mcfarlm3 1ec4e1590b feat: stub out remote and replication commands and subcommands (#254)
* feat: stubbed out remote and replication commands and subcommands

* refactor: renamed remote.go file to match command

* refactor: combined replication metrics and replication list subcommands into list only

* refactor: removed extra appends to pass lint check
2021-09-03 13:17:18 -07:00

72 lines
1.9 KiB
Go

package main
import (
"fmt"
"github.com/influxdata/influx-cli/v2/pkg/cli/middleware"
"github.com/urfave/cli"
)
func newReplicationCmd() cli.Command {
return cli.Command{
Name: "replication",
Usage: "Replication stream management commands",
Hidden: true, // Remove this line when all subcommands are completed
Subcommands: []cli.Command{
newReplicationCreateCmd(),
newReplicationDeleteCmd(),
newReplicationListCmd(),
newReplicationUpdateCmd(),
},
}
}
func newReplicationCreateCmd() cli.Command {
return cli.Command{
Name: "create",
Usage: "Create a new replication stream",
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: commonFlags(),
Action: func(ctx *cli.Context) {
fmt.Println("replication create command was called")
},
}
}
func newReplicationDeleteCmd() cli.Command {
return cli.Command{
Name: "delete",
Usage: "Delete an existing replication stream",
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: commonFlags(),
Action: func(ctx *cli.Context) {
fmt.Println("replication delete command was called")
},
}
}
func newReplicationListCmd() cli.Command {
return cli.Command{
Name: "list",
Usage: "List all replication streams and corresponding metrics",
Aliases: []string{"find", "ls"},
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: commonFlags(),
Action: func(ctx *cli.Context) {
fmt.Println("replication list command was called")
},
}
}
func newReplicationUpdateCmd() cli.Command {
return cli.Command{
Name: "update",
Usage: "Update an existing replication stream",
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: commonFlags(),
Action: func(ctx *cli.Context) {
fmt.Println("replication update command was called")
},
}
}