blob: 9d8632cbea675853d506f6e7cad93feea4ec06e6 [file] [log] [blame]
Jon Perritt85ed5232015-01-16 09:14:51 -07001package base
2
3import (
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.
11func 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.
22func 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 Perritt7e62df12015-01-23 11:49:44 -070027 OmitAccept: true,
Jon Perritt85ed5232015-01-16 09:14:51 -070028 })
29 return res
30}