blob: 4169e8cc996283a93874777effafdf1073317d3b [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
Ash Wilsonf98df8d2015-02-12 15:46:40 -05009 _, res.Err = c.Request("GET", getURL(c), gophercloud.RequestOpts{
10 JSONResponse: &res.Body,
Jon Perritt85ed5232015-01-16 09:14:51 -070011 })
12 return res
13}
14
15// Ping retrieves a ping to the server.
16func Ping(c *gophercloud.ServiceClient) PingResult {
17 var res PingResult
Ash Wilsonf98df8d2015-02-12 15:46:40 -050018 _, res.Err = c.Request("GET", pingURL(c), gophercloud.RequestOpts{
Jon Perritt85ed5232015-01-16 09:14:51 -070019 OkCodes: []int{204},
Ash Wilsonf98df8d2015-02-12 15:46:40 -050020 MoreHeaders: map[string]string{"Accept": ""},
Jon Perritt85ed5232015-01-16 09:14:51 -070021 })
22 return res
23}