blob: 46b7d60cd6944ff4afd313d472a8de4aa2e1ae16 [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)
jrperritt29ae6b32016-04-13 12:59:37 -050011 return
Ash Wilson61dcb022014-10-03 08:15:47 -040012}
13
Ash Wilson8e1fc8d2014-10-03 08:35:33 -040014// List returns a Pager which allows you to iterate over the full collection of extensions.
15// It does not accept query parameters.
Ash Wilson61dcb022014-10-03 08:15:47 -040016func List(c *gophercloud.ServiceClient) pagination.Pager {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040017 return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page {
Ash Wilson61dcb022014-10-03 08:15:47 -040018 return ExtensionPage{pagination.SinglePageBase(r)}
19 })
20}