2015-03-12 00:46:25 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
func (c *Sys) Renew(id string) (*Secret, error) {
|
2015-03-13 17:32:22 +00:00
|
|
|
r := c.c.NewRequest("PUT", "/v1/sys/renew/"+id)
|
2015-03-12 00:46:25 +00:00
|
|
|
resp, err := c.c.RawRequest(r)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
defer resp.Body.Close()
|
|
|
|
|
2015-03-12 00:47:47 +00:00
|
|
|
return ParseSecret(resp.Body)
|
2015-03-12 00:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Sys) Revoke(id string) error {
|
2015-03-13 17:32:22 +00:00
|
|
|
r := c.c.NewRequest("PUT", "/v1/sys/revoke/"+id)
|
2015-03-12 00:46:25 +00:00
|
|
|
resp, err := c.c.RawRequest(r)
|
2015-04-01 02:21:02 +00:00
|
|
|
if err == nil {
|
|
|
|
defer resp.Body.Close()
|
|
|
|
}
|
2015-03-12 00:46:25 +00:00
|
|
|
return err
|
|
|
|
}
|
2015-04-01 02:23:52 +00:00
|
|
|
|
|
|
|
func (c *Sys) RevokePrefix(id string) error {
|
|
|
|
r := c.c.NewRequest("PUT", "/v1/sys/revoke-prefix/"+id)
|
|
|
|
resp, err := c.c.RawRequest(r)
|
|
|
|
if err == nil {
|
|
|
|
defer resp.Body.Close()
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|