blob: d3c9b52b57d67dec988bd89b65b6424bfb1b1ea3 [file] [log] [blame]
Jon Perrittfd53bba2014-10-03 00:41:22 -05001package apiversions
2
3import (
Krzysztof Szukiełojć3f41d082017-05-07 14:43:06 +02004 "gerrit.mcp.mirantis.net/debian/gophercloud.git"
Krzysztof Szukiełojć24a29ce2017-05-07 14:24:02 +02005 "gerrit.mcp.mirantis.net/debian/gophercloud.git/pagination"
Jon Perrittfd53bba2014-10-03 00:41:22 -05006)
7
Jamie Hannafordd8275bb2014-10-06 16:12:23 +02008// List lists all the Cinder API versions available to end-users.
Jon Perrittfd53bba2014-10-03 00:41:22 -05009func List(c *gophercloud.ServiceClient) pagination.Pager {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040010 return pagination.NewPager(c, listURL(c), func(r pagination.PageResult) pagination.Page {
Jon Perrittfd53bba2014-10-03 00:41:22 -050011 return APIVersionPage{pagination.SinglePageBase(r)}
12 })
13}
14
15// Get will retrieve the volume type with the provided ID. To extract the volume
16// type from the result, call the Extract method on the GetResult.
Jon Perritt3860b512016-03-29 12:01:48 -050017func Get(client *gophercloud.ServiceClient, v string) (r GetResult) {
Jon Perrittdb0ae142016-03-13 00:33:41 -060018 _, r.Err = client.Get(getURL(client, v), &r.Body, nil)
jrperritt29ae6b32016-04-13 12:59:37 -050019 return
Jon Perrittfd53bba2014-10-03 00:41:22 -050020}