1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-06 06:45:35 +01:00

7 Commits

Author SHA1 Message Date
Prashanth Pai
a19b8ae856 restclient: Refactor error response handling
* 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>
2018-07-30 09:13:19 +05:30
Aravinda VK
20c9f90929 Include error message in restclient response
Fixes: #626
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-04-02 11:03:44 +05:30
Aravinda VK
d574774a70 cli: CLI log and messages improvements
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>
2018-02-14 11:19:35 +05:30
Aravinda VK
59bb2a8cac restclient: Cleaned up restclient APIs
- 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>
2017-08-10 15:12:37 +05:30
Aravinda VK
5a3282a68c restclient: Redundant json marshal and APIs simplified
Updates: #265
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2017-08-10 15:12:37 +05:30
Aravinda VK
a69e54cdd0 restclient: Fixed volume create API and others
Updates: #265
Signed-off-by: Aravinda VK <mail@aravindavk.in>
2017-08-10 15:12:37 +05:30
Aravinda VK
b618f9d222 restclient: Golang REST Client library
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
2017-08-10 15:12:37 +05:30