terraform/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/ping.go

30 lines
628 B
Go
Raw Normal View History

package oneandone
import "net/http"
// GET /ping
// Returns "PONG" if API is running
func (api *API) Ping() ([]string, error) {
url := createUrl(api, pingPathSegment)
result := []string{}
err := api.Client.Get(url, &result, http.StatusOK)
if err != nil {
return nil, err
}
return result, nil
}
// GET /ping_auth
// Returns "PONG" if the API is running and the authentication token is valid
func (api *API) PingAuth() ([]string, error) {
url := createUrl(api, pingAuthPathSegment)
result := []string{}
err := api.Client.Get(url, &result, http.StatusOK)
if err != nil {
return nil, err
}
return result, nil
}