summaryrefslogtreecommitdiffstats
path: root/model/client4.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/client4.go')
-rw-r--r--model/client4.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index 4c46d6d57..758a9e42f 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -154,6 +154,10 @@ func (c *Client4) GetDatabaseRoute() string {
return fmt.Sprintf("/database")
}
+func (c *Client4) GetClusterRoute() string {
+ return fmt.Sprintf("/cluster")
+}
+
func (c *Client4) GetIncomingWebhooksRoute() string {
return fmt.Sprintf("/hooks/incoming")
}
@@ -1414,3 +1418,15 @@ func (c *Client4) DownloadComplianceReport(reportId string) ([]byte, *Response)
return data, BuildResponse(rp)
}
}
+
+// Cluster Section
+
+// GetClusterStatus returns the status of all the configured cluster nodes.
+func (c *Client4) GetClusterStatus() ([]*ClusterInfo, *Response) {
+ if r, err := c.DoApiGet(c.GetClusterRoute()+"/status", ""); err != nil {
+ return nil, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return ClusterInfosFromJson(r.Body), BuildResponse(r)
+ }
+}