Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 1 | package base |
| 2 | |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 3 | import "github.com/gophercloud/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. |
Jon Perritt | 3860b51 | 2016-03-29 12:01:48 -0500 | [diff] [blame] | 7 | func Get(c *gophercloud.ServiceClient) (r GetResult) { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 8 | _, r.Err = c.Get(getURL(c), &r.Body, nil) |
jrperritt | 29ae6b3 | 2016-04-13 12:59:37 -0500 | [diff] [blame] | 9 | return |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 10 | } |
| 11 | |
| 12 | // Ping retrieves a ping to the server. |
Jon Perritt | 3860b51 | 2016-03-29 12:01:48 -0500 | [diff] [blame] | 13 | func Ping(c *gophercloud.ServiceClient) (r PingResult) { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 14 | _, r.Err = c.Get(pingURL(c), nil, &gophercloud.RequestOpts{ |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 15 | OkCodes: []int{204}, |
Ash Wilson | f98df8d | 2015-02-12 15:46:40 -0500 | [diff] [blame] | 16 | MoreHeaders: map[string]string{"Accept": ""}, |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 17 | }) |
jrperritt | 29ae6b3 | 2016-04-13 12:59:37 -0500 | [diff] [blame] | 18 | return |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 19 | } |