blob: b3a39f7ba53b0acfc8ff6caf64a7b4230ccc730d [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
10// ListVersions lists all the Cinder API versions available to end-users.
11func 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}