[MM-29220] Adds a client function that retrieves the full status report (#15727)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Miguel de la Cruz
2020-10-26 15:45:58 +01:00
коммит произвёл GitHub
родитель 9484366784
Коммит 8f895908fc

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

@@ -3272,6 +3272,21 @@ func (c *Client4) GetPingWithServerStatus() (string, *Response) {
return MapFromJson(r.Body)["status"], BuildResponse(r)
}
// GetPingWithFullServerStatus will return the full status if several basic server
// health checks all pass successfully.
func (c *Client4) GetPingWithFullServerStatus() (map[string]string, *Response) {
r, err := c.DoApiGet(c.GetSystemRoute()+"/ping?get_server_status="+c.boolString(true), "")
if r != nil && r.StatusCode == 500 {
defer r.Body.Close()
return map[string]string{"status": STATUS_UNHEALTHY}, BuildErrorResponse(r, err)
}
if err != nil {
return nil, BuildErrorResponse(r, err)
}
defer closeBody(r)
return MapFromJson(r.Body), BuildResponse(r)
}
// TestEmail will attempt to connect to the configured SMTP server.
func (c *Client4) TestEmail(config *Config) (bool, *Response) {
r, err := c.DoApiPost(c.GetTestEmailRoute(), config.ToJson())