* Simplify the do() method. Abstract creation of HTTP error.
* Save the last error response received from the server in the
restclient.Client instance which can be accessed using the
LastErrorResponse() method.
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Need some work on handling different error codes and add detailed
messages to users. With this patch, GlusterCLI handles Glusterd down
or not reachable error.
Signed-off-by: Aravinda VK <avishwan@redhat.com>
- Separated `PeerDetachByID` and `PeerDetach APIs`
- Added `Peers()`
TODO: Duplicate copy of same volinfo and bricksinfo struct in
pkg/api, This needs to be fixed.
Signed-off-by: Aravinda VK <mail@aravindavk.in>
REST Client for Glusterd2 APIs. Initially these APIs will be used by
CLI project, it can be used by any application which is written in Go
lang.
Example:
package main
import (
"fmt"
"github.com/gluster/glusterd2/pkg/restclient"
)
func main(){
client := restclient.NewRESTClient("http://localhost:24007", "", "")
err := client.VolumeStart("gv1")
if err != nil{
fmt.Println("Failed to Start Volume gv1")
} else{
fmt.Println("Started Volume gv1 successfully")
}
}
Signed-off-by: Aravinda VK mail@aravindavk.in
Updates: #265