diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a98e4771fb1..d692c879a7c 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1687,18 +1687,18 @@ }, { "ImportPath": "github.com/heketi/heketi/client/api/go-client", - "Comment": "v4.0.0-22-g7a54b6f", - "Rev": "7a54b6fc903feab1e7cb6573177ca09b544eb1e2" + "Comment": "2017-06-21T10:47:05Z", + "Rev": "aaf40619d85fda757e7a1c1ea1b5118cea65594b" }, { "ImportPath": "github.com/heketi/heketi/pkg/glusterfs/api", - "Comment": "v4.0.0-22-g7a54b6f", - "Rev": "7a54b6fc903feab1e7cb6573177ca09b544eb1e2" + "Comment": "2017-06-21T10:47:05Z", + "Rev": "aaf40619d85fda757e7a1c1ea1b5118cea65594b" }, { "ImportPath": "github.com/heketi/heketi/pkg/utils", - "Comment": "v4.0.0-22-g7a54b6f", - "Rev": "7a54b6fc903feab1e7cb6573177ca09b544eb1e2" + "Comment": "2017-06-21T10:47:05Z", + "Rev": "aaf40619d85fda757e7a1c1ea1b5118cea65594b" }, { "ImportPath": "github.com/howeyc/gopass", diff --git a/vendor/github.com/heketi/heketi/client/api/go-client/cluster.go b/vendor/github.com/heketi/heketi/client/api/go-client/cluster.go index 269381b0a95..ddab70dac54 100644 --- a/vendor/github.com/heketi/heketi/client/api/go-client/cluster.go +++ b/vendor/github.com/heketi/heketi/client/api/go-client/cluster.go @@ -14,9 +14,10 @@ package client import ( "bytes" + "net/http" + "github.com/heketi/heketi/pkg/glusterfs/api" "github.com/heketi/heketi/pkg/utils" - "net/http" ) func (c *Client) ClusterCreate() (*api.ClusterInfoResponse, error) { diff --git a/vendor/github.com/heketi/heketi/client/api/go-client/device.go b/vendor/github.com/heketi/heketi/client/api/go-client/device.go index 6d7dfeb817c..50412521a56 100644 --- a/vendor/github.com/heketi/heketi/client/api/go-client/device.go +++ b/vendor/github.com/heketi/heketi/client/api/go-client/device.go @@ -15,10 +15,11 @@ package client import ( "bytes" "encoding/json" - "github.com/heketi/heketi/pkg/glusterfs/api" - "github.com/heketi/heketi/pkg/utils" "net/http" "time" + + "github.com/heketi/heketi/pkg/glusterfs/api" + "github.com/heketi/heketi/pkg/utils" ) func (c *Client) DeviceAdd(request *api.DeviceAddRequest) error { @@ -131,42 +132,6 @@ func (c *Client) DeviceDelete(id string) error { return nil } -func (c *Client) DeviceRemove(id string) error { - - // Create a request - req, err := http.NewRequest("POST", - c.host+"/devices/"+id+"/remove", - nil) - if err != nil { - return err - } - - // Set token - err = c.setToken(req) - if err != nil { - return err - } - - // Send request - r, err := c.do(req) - if err != nil { - return err - } - if r.StatusCode != http.StatusAccepted { - return utils.GetErrorFromResponse(r) - } - - // Wait for response - r, err = c.waitForResponseWithTimer(r, time.Second) - if err != nil { - return err - } - if r.StatusCode != http.StatusNoContent { - return utils.GetErrorFromResponse(r) - } - - return nil -} func (c *Client) DeviceState(id string, request *api.StateRequest) error { @@ -196,8 +161,18 @@ func (c *Client) DeviceState(id string, if err != nil { return err } - if r.StatusCode != http.StatusOK { + if r.StatusCode != http.StatusAccepted { return utils.GetErrorFromResponse(r) } + + // Wait for response + r, err = c.waitForResponseWithTimer(r, time.Second) + if err != nil { + return err + } + if r.StatusCode != http.StatusNoContent { + return utils.GetErrorFromResponse(r) + } + return nil } diff --git a/vendor/github.com/heketi/heketi/client/api/go-client/node.go b/vendor/github.com/heketi/heketi/client/api/go-client/node.go index e40940e61af..20039c1ef43 100644 --- a/vendor/github.com/heketi/heketi/client/api/go-client/node.go +++ b/vendor/github.com/heketi/heketi/client/api/go-client/node.go @@ -15,10 +15,11 @@ package client import ( "bytes" "encoding/json" - "github.com/heketi/heketi/pkg/glusterfs/api" - "github.com/heketi/heketi/pkg/utils" "net/http" "time" + + "github.com/heketi/heketi/pkg/glusterfs/api" + "github.com/heketi/heketi/pkg/utils" ) func (c *Client) NodeAdd(request *api.NodeAddRequest) (*api.NodeInfoResponse, error) { @@ -167,8 +168,18 @@ func (c *Client) NodeState(id string, request *api.StateRequest) error { if err != nil { return err } - if r.StatusCode != http.StatusOK { + if r.StatusCode != http.StatusAccepted { return utils.GetErrorFromResponse(r) } + + // Wait for response + r, err = c.waitForResponseWithTimer(r, time.Second) + if err != nil { + return err + } + if r.StatusCode != http.StatusNoContent { + return utils.GetErrorFromResponse(r) + } + return nil } diff --git a/vendor/github.com/heketi/heketi/pkg/glusterfs/api/types.go b/vendor/github.com/heketi/heketi/pkg/glusterfs/api/types.go index e3a985b49f9..c244f5af9b9 100644 --- a/vendor/github.com/heketi/heketi/pkg/glusterfs/api/types.go +++ b/vendor/github.com/heketi/heketi/pkg/glusterfs/api/types.go @@ -148,12 +148,13 @@ type VolumeDurabilityInfo struct { type VolumeCreateRequest struct { // Size in GB - Size int `json:"size"` - Clusters []string `json:"clusters,omitempty"` - Name string `json:"name"` - Durability VolumeDurabilityInfo `json:"durability,omitempty"` - Gid int64 `json:"gid,omitempty"` - Snapshot struct { + Size int `json:"size"` + Clusters []string `json:"clusters,omitempty"` + Name string `json:"name"` + Durability VolumeDurabilityInfo `json:"durability,omitempty"` + Gid int64 `json:"gid,omitempty"` + GlusterVolumeOptions []string `json:"glustervolumeoptions,omitempty"` + Snapshot struct { Enable bool `json:"enable"` Factor float32 `json:"factor"` } `json:"snapshot"`