2016-02-27 00:43:55 +00:00
|
|
|
package api
|
|
|
|
|
2018-07-24 22:49:55 +00:00
|
|
|
import "context"
|
|
|
|
|
2016-02-27 00:43:55 +00:00
|
|
|
func (c *Sys) StepDown() error {
|
|
|
|
r := c.c.NewRequest("PUT", "/v1/sys/step-down")
|
2018-07-24 22:49:55 +00:00
|
|
|
|
|
|
|
ctx, cancelFunc := context.WithCancel(context.Background())
|
|
|
|
defer cancelFunc()
|
|
|
|
resp, err := c.c.RawRequestWithContext(ctx, r)
|
2016-02-27 00:43:55 +00:00
|
|
|
if err == nil {
|
|
|
|
defer resp.Body.Close()
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|