StorageOS update api library
This commit is contained in:
23
vendor/github.com/storageos/go-api/pool.go
generated
vendored
23
vendor/github.com/storageos/go-api/pool.go
generated
vendored
@@ -41,7 +41,7 @@ func (c *Client) PoolList(opts types.ListOptions) ([]*types.Pool, error) {
|
||||
}
|
||||
|
||||
// PoolCreate creates a pool on the server and returns the new object.
|
||||
func (c *Client) PoolCreate(opts types.PoolCreateOptions) (*types.Pool, error) {
|
||||
func (c *Client) PoolCreate(opts types.PoolOptions) (*types.Pool, error) {
|
||||
resp, err := c.do("POST", PoolAPIPrefix, doOptions{
|
||||
data: opts,
|
||||
context: opts.Context,
|
||||
@@ -56,6 +56,27 @@ func (c *Client) PoolCreate(opts types.PoolCreateOptions) (*types.Pool, error) {
|
||||
return &pool, nil
|
||||
}
|
||||
|
||||
// PoolUpdate - update pool
|
||||
func (c *Client) PoolUpdate(opts types.PoolOptions) (*types.Pool, error) {
|
||||
ref := opts.Name
|
||||
if IsUUID(opts.ID) {
|
||||
ref = opts.ID
|
||||
}
|
||||
|
||||
resp, err := c.do("PUT", PoolAPIPrefix+"/"+ref, doOptions{
|
||||
data: opts,
|
||||
context: opts.Context,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var pool types.Pool
|
||||
if err := json.NewDecoder(resp.Body).Decode(&pool); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &pool, nil
|
||||
}
|
||||
|
||||
// Pool returns a pool by its reference.
|
||||
func (c *Client) Pool(ref string) (*types.Pool, error) {
|
||||
resp, err := c.do("GET", PoolAPIPrefix+"/"+ref, doOptions{})
|
||||
|
Reference in New Issue
Block a user