From 27d2c1f6febdc6b80f60837086ebe0c08f975147 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Mon, 13 Mar 2017 16:47:33 +0100 Subject: Add implementation for POST /database/recycle apiV4 - Recycle database connection (#5717) --- model/client4.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'model') diff --git a/model/client4.go b/model/client4.go index b6c2daf0f..4c46d6d57 100644 --- a/model/client4.go +++ b/model/client4.go @@ -150,6 +150,10 @@ func (c *Client4) GetTestEmailRoute() string { return fmt.Sprintf("/email/test") } +func (c *Client4) GetDatabaseRoute() string { + return fmt.Sprintf("/database") +} + func (c *Client4) GetIncomingWebhooksRoute() string { return fmt.Sprintf("/hooks/incoming") } @@ -1088,6 +1092,15 @@ func (c *Client4) GetConfig() (*Config, *Response) { } } +func (c *Client4) DatabaseRecycle() (bool, *Response) { + if r, err := c.DoApiPost(c.GetDatabaseRoute()+"/recycle", ""); err != nil { + return false, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return CheckStatusOK(r), BuildResponse(r) + } +} + // Webhooks Section // CreateIncomingWebhook creates an incoming webhook for a channel. -- cgit v1.2.3-1-g7c22