api: use /v1 prefix

This commit is contained in:
Mitchell Hashimoto 2015-03-13 10:32:22 -07:00
parent f71f29b801
commit c0ede206bb
6 changed files with 15 additions and 15 deletions

View File

@ -5,7 +5,7 @@ import (
)
func (c *Sys) ListAuth() ([]*AuthResponse, error) {
r := c.c.NewRequest("GET", "/sys/auth")
r := c.c.NewRequest("GET", "/v1/sys/auth")
resp, err := c.c.RawRequest(r)
if err != nil {
return nil, err
@ -24,7 +24,7 @@ func (c *Sys) EnableAuth(id string, opts *AuthRequest) error {
}
body["type"] = opts.Type
r := c.c.NewRequest("PUT", fmt.Sprintf("/sys/auth/%s", id))
r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/sys/auth/%s", id))
if err := r.SetJSONBody(body); err != nil {
return err
}
@ -39,7 +39,7 @@ func (c *Sys) EnableAuth(id string, opts *AuthRequest) error {
}
func (c *Sys) DisableAuth(id string) error {
r := c.c.NewRequest("DELETE", fmt.Sprintf("/sys/auth/%s", id))
r := c.c.NewRequest("DELETE", fmt.Sprintf("/v1/sys/auth/%s", id))
resp, err := c.c.RawRequest(r)
defer resp.Body.Close()
return err

View File

@ -1,7 +1,7 @@
package api
func (c *Sys) InitStatus() (bool, error) {
r := c.c.NewRequest("GET", "/sys/init")
r := c.c.NewRequest("GET", "/v1/sys/init")
resp, err := c.c.RawRequest(r)
if err != nil {
return false, err
@ -19,7 +19,7 @@ func (c *Sys) Init(opts *InitRequest) (*InitResponse, error) {
"secret_threshold": opts.SecretThreshold,
}
r := c.c.NewRequest("PUT", "/sys/init")
r := c.c.NewRequest("PUT", "/v1/sys/init")
if err := r.SetJSONBody(body); err != nil {
return nil, err
}

View File

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

View File

@ -11,7 +11,7 @@ import (
// at any time from the client using `client.Token()` and it can be cleared
// with `sys.Logout()`.
func (c *Sys) Login(vars map[string]string) error {
r := c.c.NewRequest("PUT", "/sys/login")
r := c.c.NewRequest("PUT", "/v1/sys/login")
if err := r.SetJSONBody(vars); err != nil {
return err
}

View File

@ -5,7 +5,7 @@ import (
)
func (c *Sys) ListMounts() (map[string]*Mount, error) {
r := c.c.NewRequest("GET", "/sys/mounts")
r := c.c.NewRequest("GET", "/v1/sys/mounts")
resp, err := c.c.RawRequest(r)
if err != nil {
return nil, err
@ -27,7 +27,7 @@ func (c *Sys) Mount(path, mountType, description string) error {
"description": description,
}
r := c.c.NewRequest("POST", fmt.Sprintf("/sys/mounts/%s", path))
r := c.c.NewRequest("POST", fmt.Sprintf("/v1/sys/mounts/%s", path))
if err := r.SetJSONBody(body); err != nil {
return err
}
@ -46,7 +46,7 @@ func (c *Sys) Unmount(path string) error {
return err
}
r := c.c.NewRequest("DELETE", fmt.Sprintf("/sys/mounts/%s", path))
r := c.c.NewRequest("DELETE", fmt.Sprintf("/v1/sys/mounts/%s", path))
resp, err := c.c.RawRequest(r)
defer resp.Body.Close()
return err
@ -65,7 +65,7 @@ func (c *Sys) Remount(from, to string) error {
"to": to,
}
r := c.c.NewRequest("POST", "/sys/remount")
r := c.c.NewRequest("POST", "/v1/sys/remount")
if err := r.SetJSONBody(body); err != nil {
return err
}

View File

@ -1,7 +1,7 @@
package api
func (c *Sys) SealStatus() (*SealStatusResponse, error) {
r := c.c.NewRequest("GET", "/sys/seal-status")
r := c.c.NewRequest("GET", "/v1/sys/seal-status")
resp, err := c.c.RawRequest(r)
if err != nil {
return nil, err
@ -14,7 +14,7 @@ func (c *Sys) SealStatus() (*SealStatusResponse, error) {
}
func (c *Sys) Seal() error {
r := c.c.NewRequest("PUT", "/sys/seal")
r := c.c.NewRequest("PUT", "/v1/sys/seal")
resp, err := c.c.RawRequest(r)
defer resp.Body.Close()
return err
@ -23,7 +23,7 @@ func (c *Sys) Seal() error {
func (c *Sys) Unseal(shard string) (*SealStatusResponse, error) {
body := map[string]interface{}{"key": shard}
r := c.c.NewRequest("PUT", "/sys/unseal")
r := c.c.NewRequest("PUT", "/v1/sys/unseal")
if err := r.SetJSONBody(body); err != nil {
return nil, err
}