blob: bc1ce3e88753d13d74fcb819b0304ef3ec97fe94 [file] [log] [blame]
Ash Wilson61dcb022014-10-03 08:15:47 -04001package extensions
2
3import (
Jon Perritt27249f42016-02-18 10:35:59 -06004 "github.com/gophercloud/gophercloud"
5 "github.com/gophercloud/gophercloud/pagination"
Ash Wilson61dcb022014-10-03 08:15:47 -04006)
7
8// Get retrieves information for a specific extension using its alias.
Jon Perritt3860b512016-03-29 12:01:48 -05009func Get(c *gophercloud.ServiceClient, alias string) (r GetResult) {
Jon Perrittdb0ae142016-03-13 00:33:41 -060010 _, r.Err = c.Get(ExtensionURL(c, alias), &r.Body, nil)
Ash Wilson61dcb022014-10-03 08:15:47 -040011}
12
Ash Wilson8e1fc8d2014-10-03 08:35:33 -040013// List returns a Pager which allows you to iterate over the full collection of extensions.
14// It does not accept query parameters.
Ash Wilson61dcb022014-10-03 08:15:47 -040015func List(c *gophercloud.ServiceClient) pagination.Pager {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040016 return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page {
Ash Wilson61dcb022014-10-03 08:15:47 -040017 return ExtensionPage{pagination.SinglePageBase(r)}
18 })
19}