blob: 05bf35d834d5d8ca72110e31af8d9a0666b39fd7 [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.
9func Get(c *gophercloud.ServiceClient, alias string) GetResult {
Jon Perrittdb0ae142016-03-13 00:33:41 -060010 var r GetResult
11 _, r.Err = c.Get(ExtensionURL(c, alias), &r.Body, nil)
12 return r
Ash Wilson61dcb022014-10-03 08:15:47 -040013}
14
Ash Wilson8e1fc8d2014-10-03 08:35:33 -040015// List returns a Pager which allows you to iterate over the full collection of extensions.
16// It does not accept query parameters.
Ash Wilson61dcb022014-10-03 08:15:47 -040017func List(c *gophercloud.ServiceClient) pagination.Pager {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040018 return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page {
Ash Wilson61dcb022014-10-03 08:15:47 -040019 return ExtensionPage{pagination.SinglePageBase(r)}
20 })
21}