blob: b653f516170b7bfa716477799965e3f452d7610b [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 {
Jamie Hannafordc65e1922014-09-22 13:20:58 +020010 return pagination.NewPager(c, apiVersionsURL(c), func(r pagination.LastHTTPResponse) pagination.Page {
Jamie Hannafordf0c615b2014-09-17 10:56:52 +020011 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 {
Jamie Hannafordc65e1922014-09-22 13:20:58 +020018 return pagination.NewPager(c, apiInfoURL(c, v), func(r pagination.LastHTTPResponse) pagination.Page {
Jamie Hannafordf0c615b2014-09-17 10:56:52 +020019 return APIVersionResourcePage{pagination.SinglePageBase(r)}
20 })
Jamie Hannaford4721abc2014-09-16 16:29:04 +020021}