blob: 59ece85090b4779109268e63ce49bd0de71cbd88 [file] [log] [blame]
Jamie Hannaford4721abc2014-09-16 16:29:04 +02001package apiversions
2
Jamie Hannafordf0c615b2014-09-17 10:56:52 +02003import (
Jon Perritt27249f42016-02-18 10:35:59 -06004 "github.com/gophercloud/gophercloud"
5 "github.com/gophercloud/gophercloud/pagination"
Jamie Hannafordf0c615b2014-09-17 10:56:52 +02006)
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}