mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-29 11:55:03 +01:00
29 lines
506 B
Go
29 lines
506 B
Go
|
package client
|
||
|
|
||
|
import (
|
||
|
"github.com/pkg/errors"
|
||
|
"github.com/zrepl/zrepl/config"
|
||
|
"github.com/zrepl/zrepl/daemon"
|
||
|
)
|
||
|
|
||
|
func RunWakeup(config config.Config, args []string) error {
|
||
|
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
|
||
|
}
|