mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-22 19:21:09 +01:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
27 lines
524 B
Go
27 lines
524 B
Go
// Copyright IBM Corp. 2016, 2025
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package api
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
func (c *Sys) StepDown() error {
|
|
return c.StepDownWithContext(context.Background())
|
|
}
|
|
|
|
func (c *Sys) StepDownWithContext(ctx context.Context) error {
|
|
ctx, cancelFunc := c.c.withConfiguredTimeout(ctx)
|
|
defer cancelFunc()
|
|
|
|
r := c.c.NewRequest(http.MethodPut, "/v1/sys/step-down")
|
|
|
|
resp, err := c.c.rawRequestWithContext(ctx, r)
|
|
if resp != nil && resp.Body != nil {
|
|
resp.Body.Close()
|
|
}
|
|
return err
|
|
}
|