blob: 8f7fd675b1f8612b94f5acb19615880721fe6b57 [file] [log] [blame]
Ash Wilson61dcb022014-10-03 08:15:47 -04001package extensions
2
3import (
4 "github.com/racker/perigee"
5 "github.com/rackspace/gophercloud"
6 "github.com/rackspace/gophercloud/pagination"
7)
8
9// Get retrieves information for a specific extension using its alias.
10func Get(c *gophercloud.ServiceClient, alias string) GetResult {
11 var res GetResult
12 _, err := perigee.Request("GET", extensionURL(c, alias), perigee.Options{
13 MoreHeaders: c.Provider.AuthenticatedHeaders(),
14 Results: &res.Resp,
15 OkCodes: []int{200},
16 })
17 res.Err = err
18 return res
19}
20
21// List returns a Pager which allows you to iterate over the full collection of
22// extensions. It does not accept query parameters.
23func List(c *gophercloud.ServiceClient) pagination.Pager {
24 return pagination.NewPager(c, listExtensionURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
25 return ExtensionPage{pagination.SinglePageBase(r)}
26 })
27}