blob: 0698cbdff2b8890dd6f1c9315745bca1fb9284b4 [file] [log] [blame]
Jon Perritt85ed5232015-01-16 09:14:51 -07001package base
2
Krzysztof Szukiełojć3f41d082017-05-07 14:43:06 +02003import "gerrit.mcp.mirantis.net/debian/gophercloud.git"
Jon Perritt85ed5232015-01-16 09:14:51 -07004
5// Get retrieves the home document, allowing the user to discover the
6// entire API.
Jon Perritt3860b512016-03-29 12:01:48 -05007func Get(c *gophercloud.ServiceClient) (r GetResult) {
Jon Perrittdb0ae142016-03-13 00:33:41 -06008 _, r.Err = c.Get(getURL(c), &r.Body, nil)
jrperritt29ae6b32016-04-13 12:59:37 -05009 return
Jon Perritt85ed5232015-01-16 09:14:51 -070010}
11
12// Ping retrieves a ping to the server.
Jon Perritt3860b512016-03-29 12:01:48 -050013func Ping(c *gophercloud.ServiceClient) (r PingResult) {
Jon Perrittdb0ae142016-03-13 00:33:41 -060014 _, r.Err = c.Get(pingURL(c), nil, &gophercloud.RequestOpts{
Jon Perritt85ed5232015-01-16 09:14:51 -070015 OkCodes: []int{204},
Ash Wilsonf98df8d2015-02-12 15:46:40 -050016 MoreHeaders: map[string]string{"Accept": ""},
Jon Perritt85ed5232015-01-16 09:14:51 -070017 })
jrperritt29ae6b32016-04-13 12:59:37 -050018 return
Jon Perritt85ed5232015-01-16 09:14:51 -070019}