Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 1 | package base |
| 2 | |
Ash Wilson | f98df8d | 2015-02-12 15:46:40 -0500 | [diff] [blame] | 3 | import "github.com/rackspace/gophercloud" |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 4 | |
| 5 | // Get retrieves the home document, allowing the user to discover the |
| 6 | // entire API. |
| 7 | func Get(c *gophercloud.ServiceClient) GetResult { |
| 8 | var res GetResult |
Jamie Hannaford | 22aa42b | 2015-03-24 14:56:04 +0100 | [diff] [blame] | 9 | _, res.Err = c.Get(getURL(c), &res.Body, nil) |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 10 | return res |
| 11 | } |
| 12 | |
| 13 | // Ping retrieves a ping to the server. |
| 14 | func Ping(c *gophercloud.ServiceClient) PingResult { |
| 15 | var res PingResult |
Jamie Hannaford | 22aa42b | 2015-03-24 14:56:04 +0100 | [diff] [blame] | 16 | _, res.Err = c.Get(pingURL(c), nil, &gophercloud.RequestOpts{ |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 17 | OkCodes: []int{204}, |
Ash Wilson | f98df8d | 2015-02-12 15:46:40 -0500 | [diff] [blame] | 18 | MoreHeaders: map[string]string{"Accept": ""}, |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 19 | }) |
| 20 | return res |
| 21 | } |