blob: 79a939c99bff19412a5afad898c2913e6168457c [file] [log] [blame]
Jon Perrittfd53bba2014-10-03 00:41:22 -05001package apiversions
2
3import (
4 "github.com/rackspace/gophercloud"
5 "github.com/rackspace/gophercloud/pagination"
6
7 "github.com/racker/perigee"
8)
9
Jamie Hannafordd8275bb2014-10-06 16:12:23 +020010// List lists all the Cinder API versions available to end-users.
Jon Perrittfd53bba2014-10-03 00:41:22 -050011func List(c *gophercloud.ServiceClient) pagination.Pager {
12 return pagination.NewPager(c, listURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
13 return APIVersionPage{pagination.SinglePageBase(r)}
14 })
15}
16
17// Get will retrieve the volume type with the provided ID. To extract the volume
18// type from the result, call the Extract method on the GetResult.
19func Get(client *gophercloud.ServiceClient, v string) GetResult {
20 var res GetResult
21 _, err := perigee.Request("GET", getURL(client, v), perigee.Options{
22 MoreHeaders: client.Provider.AuthenticatedHeaders(),
23 OkCodes: []int{200},
24 Results: &res.Resp,
25 })
26 res.Err = err
27 return res
28}