blob: b63dc95a71a1c96083263cdcf0b2cd37498d990e [file] [log] [blame]
Jon Perritt85ed5232015-01-16 09:14:51 -07001package base
2
Ash Wilsonf98df8d2015-02-12 15:46:40 -05003import "github.com/rackspace/gophercloud"
Jon Perritt85ed5232015-01-16 09:14:51 -07004
5// Get retrieves the home document, allowing the user to discover the
6// entire API.
7func Get(c *gophercloud.ServiceClient) GetResult {
8 var res GetResult
Ash Wilsonf98df8d2015-02-12 15:46:40 -05009 _, res.Err = c.Request("GET", getURL(c), gophercloud.RequestOpts{
10 JSONResponse: &res.Body,
11 OkCodes: []int{200},
Jon Perritt85ed5232015-01-16 09:14:51 -070012 })
13 return res
14}
15
16// Ping retrieves a ping to the server.
17func Ping(c *gophercloud.ServiceClient) PingResult {
18 var res PingResult
Ash Wilsonf98df8d2015-02-12 15:46:40 -050019 _, res.Err = c.Request("GET", pingURL(c), gophercloud.RequestOpts{
Jon Perritt85ed5232015-01-16 09:14:51 -070020 OkCodes: []int{204},
Ash Wilsonf98df8d2015-02-12 15:46:40 -050021 MoreHeaders: map[string]string{"Accept": ""},
Jon Perritt85ed5232015-01-16 09:14:51 -070022 })
23 return res
24}