move wakeup subcommand into signal subcommand and add reset subcommand

This commit is contained in:
Christian Schwarz
2018-10-12 20:50:30 +02:00
parent 025fbda984
commit 89e0103abd
6 changed files with 92 additions and 13 deletions
+7 -5
View File
@@ -6,9 +6,9 @@ import (
"github.com/zrepl/zrepl/daemon"
)
func RunWakeup(config *config.Config, args []string) error {
if len(args) != 1 {
return errors.Errorf("Expected 1 argument: job")
func RunSignal(config *config.Config, args []string) error {
if len(args) != 2 {
return errors.Errorf("Expected 2 arguments: [wakeup|reset] JOB")
}
httpc, err := controlHttpClient(config.Global.Control.SockPath)
@@ -16,11 +16,13 @@ func RunWakeup(config *config.Config, args []string) error {
return err
}
err = jsonRequestResponse(httpc, daemon.ControlJobEndpointWakeup,
err = jsonRequestResponse(httpc, daemon.ControlJobEndpointSignal,
struct {
Name string
Op string
}{
Name: args[0],
Name: args[1],
Op: args[0],
},
struct{}{},
)