blob: b6f371ae1e6c6a99d5a91e19ed85ba00679eda08 [file] [log] [blame]
Ash Wilson61dcb022014-10-03 08:15:47 -04001package extensions
2
3import (
Ash Wilson61dcb022014-10-03 08:15:47 -04004 "github.com/rackspace/gophercloud"
5 "github.com/rackspace/gophercloud/pagination"
6)
7
8// Get retrieves information for a specific extension using its alias.
9func Get(c *gophercloud.ServiceClient, alias string) GetResult {
10 var res GetResult
Ash Wilson59fb6c42015-02-12 16:21:13 -050011 _, res.Err = c.Request("GET", ExtensionURL(c, alias), gophercloud.RequestOpts{
12 JSONResponse: &res.Body,
Ash Wilson61dcb022014-10-03 08:15:47 -040013 })
Ash Wilson61dcb022014-10-03 08:15:47 -040014 return res
15}
16
Ash Wilson8e1fc8d2014-10-03 08:35:33 -040017// List returns a Pager which allows you to iterate over the full collection of extensions.
18// It does not accept query parameters.
Ash Wilson61dcb022014-10-03 08:15:47 -040019func List(c *gophercloud.ServiceClient) pagination.Pager {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040020 return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page {
Ash Wilson61dcb022014-10-03 08:15:47 -040021 return ExtensionPage{pagination.SinglePageBase(r)}
22 })
23}