summaryrefslogtreecommitdiffstats
path: root/model/client4.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-07-19 09:43:05 +0100
committerGitHub <noreply@github.com>2017-07-19 09:43:05 +0100
commitfe368a74565e736ad1fb1dfc20ab364379d83ae9 (patch)
tree56186c11129a4aadc068a6387af39288cc9802b7 /model/client4.go
parent97f34e483b0fa8b2a8cfe75b72168cfa38cc9d80 (diff)
downloadchat-fe368a74565e736ad1fb1dfc20ab364379d83ae9.tar.gz
chat-fe368a74565e736ad1fb1dfc20ab364379d83ae9.tar.bz2
chat-fe368a74565e736ad1fb1dfc20ab364379d83ae9.zip
PLT-6595: API to purge Elasticsearch indexes. (#6971)
Diffstat (limited to 'model/client4.go')
-rw-r--r--model/client4.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index a19a17d3a..feff9f8de 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -2551,6 +2551,16 @@ func (c *Client4) TestElasticsearch() (bool, *Response) {
}
}
+// PurgeElasticsearchIndexes immediately deletes all Elasticsearch indexes.
+func (c *Client4) PurgeElasticsearchIndexes() (bool, *Response) {
+ if r, err := c.DoApiPost(c.GetElasticsearchRoute()+"/test", ""); err != nil {
+ return false, BuildErrorResponse(r, err)
+ } else {
+ defer closeBody(r)
+ return CheckStatusOK(r), BuildResponse(r)
+ }
+}
+
// Commands Section
// CreateCommand will create a new command if the user have the right permissions.