blob: 000151b7ad3df894caade7c3ffd5f0b05ec34335 [file] [log] [blame]
Jamie Hannaford8c072a32014-10-16 14:33:32 +02001package 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 _, res.Err = perigee.Request("GET", ExtensionURL(c, alias), perigee.Options{
13 MoreHeaders: c.Provider.AuthenticatedHeaders(),
14 Results: &res.Resp,
15 OkCodes: []int{200},
16 })
17 return res
18}
19
20// List returns a Pager which allows you to iterate over the full collection of extensions.
21// It does not accept query parameters.
22func List(c *gophercloud.ServiceClient) pagination.Pager {
23 return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
24 return ExtensionPage{pagination.SinglePageBase(r)}
25 })
26}