blob: dd221bc983bc5a4d5e2123a0af5fecd94c399642 [file] [log] [blame]
Jon Perritt85ed5232015-01-16 09:14:51 -07001package base
2
Ash Wilsonf98df8d2015-02-12 15:46:40 -05003import "github.com/rackspace/gophercloud"
Jon Perritt85ed5232015-01-16 09:14:51 -07004
5// Get retrieves the home document, allowing the user to discover the
6// entire API.
7func Get(c *gophercloud.ServiceClient) GetResult {
8 var res GetResult
Jamie Hannaford22aa42b2015-03-24 14:56:04 +01009 _, res.Err = c.Get(getURL(c), &res.Body, nil)
Jon Perritt85ed5232015-01-16 09:14:51 -070010 return res
11}
12
13// Ping retrieves a ping to the server.
14func Ping(c *gophercloud.ServiceClient) PingResult {
15 var res PingResult
Jamie Hannaford22aa42b2015-03-24 14:56:04 +010016 _, res.Err = c.Get(pingURL(c), nil, &gophercloud.RequestOpts{
Jon Perritt85ed5232015-01-16 09:14:51 -070017 OkCodes: []int{204},
Ash Wilsonf98df8d2015-02-12 15:46:40 -050018 MoreHeaders: map[string]string{"Accept": ""},
Jon Perritt85ed5232015-01-16 09:14:51 -070019 })
20 return res
21}