Add implementation for POST /database/recycle apiV4 - Recycle database connection (#5717)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-03-13 16:47:33 +01:00
коммит произвёл George Goldberg
родитель 38958d9ac4
Коммит 27d2c1f6fe
3 изменённых файлов: 39 добавлений и 0 удалений

Просмотреть файл

@@ -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.