blob: 570b9e851ee94bb87238e1cbbdbf55688e6638a5 [file] [log] [blame]
Jamie Hannaford4721abc2014-09-16 16:29:04 +02001package apiversions
2
Jamie Hannafordf0c615b2014-09-17 10:56:52 +02003import (
4 "github.com/rackspace/gophercloud"
5 "github.com/rackspace/gophercloud/pagination"
6)
Jamie Hannaford4721abc2014-09-16 16:29:04 +02007
Jamie Hannaforda311f182014-09-19 11:19:10 +02008// ListVersions lists all the Neutron API versions available to end-users
Jamie Hannafordf0c615b2014-09-17 10:56:52 +02009func ListVersions(c *gophercloud.ServiceClient) pagination.Pager {
10 return pagination.NewPager(c, APIVersionsURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
11 return APIVersionPage{pagination.SinglePageBase(r)}
12 })
Jamie Hannaford4721abc2014-09-16 16:29:04 +020013}
14
Jamie Hannaforda311f182014-09-19 11:19:10 +020015// ListVersionResources lists all of the different API resources for a particular
16// API versions. Typical resources for Neutron might be: networks, subnets, etc.
Jamie Hannafordf0c615b2014-09-17 10:56:52 +020017func ListVersionResources(c *gophercloud.ServiceClient, v string) pagination.Pager {
18 return pagination.NewPager(c, APIInfoURL(c, v), func(r pagination.LastHTTPResponse) pagination.Page {
19 return APIVersionResourcePage{pagination.SinglePageBase(r)}
20 })
Jamie Hannaford4721abc2014-09-16 16:29:04 +020021}