2018-08-29 19:17:45 +02:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
"github.com/zrepl/zrepl/config"
|
|
|
|
"github.com/zrepl/zrepl/daemon"
|
|
|
|
)
|
|
|
|
|
2018-08-31 21:50:59 +02:00
|
|
|
func RunWakeup(config *config.Config, args []string) error {
|
2018-08-29 19:17:45 +02:00
|
|
|
if len(args) != 1 {
|
|
|
|
return errors.Errorf("Expected 1 argument: job")
|
|
|
|
}
|
|
|
|
|
|
|
|
httpc, err := controlHttpClient(config.Global.Control.SockPath)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = jsonRequestResponse(httpc, daemon.ControlJobEndpointWakeup,
|
|
|
|
struct {
|
|
|
|
Name string
|
|
|
|
}{
|
|
|
|
Name: args[0],
|
|
|
|
},
|
|
|
|
struct{}{},
|
|
|
|
)
|
|
|
|
return err
|
|
|
|
}
|