open-vault/api/sys_lease.go
2015-03-13 12:53:08 -07:00

20 lines
403 B
Go

package api
func (c *Sys) Renew(id string) (*Secret, error) {
r := c.c.NewRequest("PUT", "/v1/sys/renew/"+id)
resp, err := c.c.RawRequest(r)
if err != nil {
return nil, err
}
defer resp.Body.Close()
return ParseSecret(resp.Body)
}
func (c *Sys) Revoke(id string) error {
r := c.c.NewRequest("PUT", "/v1/sys/revoke/"+id)
resp, err := c.c.RawRequest(r)
defer resp.Body.Close()
return err
}