update storageos vendor for FilteredDial change

This commit is contained in:
Matthew Cary
2020-06-10 01:02:40 +00:00
parent 2aa1cd25f3
commit 74dbf274d9
58 changed files with 239 additions and 193 deletions

43
vendor/github.com/storageos/go-api/licence.go generated vendored Normal file
View File

@@ -0,0 +1,43 @@
package storageos
import (
"encoding/json"
"github.com/storageos/go-api/types"
)
const (
// licenceAPIPrefix is a partial path to the HTTP endpoint.
licenceAPIPrefix = "licencing"
)
// Licence returns the current licence on the server.
func (c *Client) Licence() (*types.Licence, error) {
resp, err := c.do("GET", licenceAPIPrefix, doOptions{})
if err != nil {
return nil, err
}
defer resp.Body.Close()
licence := &types.Licence{}
if err := json.NewDecoder(resp.Body).Decode(&licence); err != nil {
return nil, err
}
return licence, nil
}
// LicenceApply applies a licence on the server.
func (c *Client) LicenceApply(licenceKey string) error {
_, err := c.do("POST", licenceAPIPrefix, doOptions{
data: &types.LicenceKeyContainer{Key: licenceKey},
})
return err
}
// LicenceDelete removes the current licence.
func (c *Client) LicenceDelete() error {
resp, err := c.do("DELETE", licenceAPIPrefix, doOptions{})
if err != nil {
return err
}
return resp.Body.Close()
}