Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 1 | package base |
| 2 | |
| 3 | import ( |
| 4 | "github.com/rackspace/gophercloud" |
| 5 | |
| 6 | "github.com/racker/perigee" |
| 7 | ) |
| 8 | |
| 9 | // Get retrieves the home document, allowing the user to discover the |
| 10 | // entire API. |
| 11 | func Get(c *gophercloud.ServiceClient) GetResult { |
| 12 | var res GetResult |
| 13 | _, res.Err = perigee.Request("GET", getURL(c), perigee.Options{ |
| 14 | MoreHeaders: c.AuthenticatedHeaders(), |
| 15 | Results: &res.Body, |
| 16 | OkCodes: []int{200}, |
| 17 | }) |
| 18 | return res |
| 19 | } |
| 20 | |
| 21 | // Ping retrieves a ping to the server. |
| 22 | func Ping(c *gophercloud.ServiceClient) PingResult { |
| 23 | var res PingResult |
| 24 | _, res.Err = perigee.Request("GET", pingURL(c), perigee.Options{ |
| 25 | MoreHeaders: c.AuthenticatedHeaders(), |
| 26 | OkCodes: []int{204}, |
Jon Perritt | 7e62df1 | 2015-01-23 11:49:44 -0700 | [diff] [blame] | 27 | OmitAccept: true, |
Jon Perritt | 85ed523 | 2015-01-16 09:14:51 -0700 | [diff] [blame] | 28 | }) |
| 29 | return res |
| 30 | } |