blob: d63522b80895c2a51256c0407eb358df5bee3985 [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},
27 })
28 return res
29}