blob: dfd81c99a0dfd9555852aef732b08181789fec0f [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,
13 OkCodes: []int{200},
Ash Wilson61dcb022014-10-03 08:15:47 -040014 })
Ash Wilson61dcb022014-10-03 08:15:47 -040015 return res
16}
17
Ash Wilson8e1fc8d2014-10-03 08:35:33 -040018// List returns a Pager which allows you to iterate over the full collection of extensions.
19// It does not accept query parameters.
Ash Wilson61dcb022014-10-03 08:15:47 -040020func List(c *gophercloud.ServiceClient) pagination.Pager {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040021 return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page {
Ash Wilson61dcb022014-10-03 08:15:47 -040022 return ExtensionPage{pagination.SinglePageBase(r)}
23 })
24}