blob: 9fb6de14110c5da6d6152fea6efddf41a8cd7f76 [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 {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040010 return pagination.NewPager(c, apiVersionsURL(c), func(r pagination.PageResult) 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 {
Ash Wilsonb8b16f82014-10-20 10:19:49 -040018 return pagination.NewPager(c, apiInfoURL(c, v), func(r pagination.PageResult) pagination.Page {
Jamie Hannafordf0c615b2014-09-17 10:56:52 +020019 return APIVersionResourcePage{pagination.SinglePageBase(r)}
20 })
Jamie Hannaford4721abc2014-09-16 16:29:04 +020021}