requests.go 867 B

1234567891011121314151617181920212223
  1. package apiversions
  2. import (
  3. "devel.mephi.ru/iacherepanov/openstack-gophercloud"
  4. "devel.mephi.ru/iacherepanov/openstack-gophercloud/pagination"
  5. )
  6. // ListVersions lists all the Neutron API versions available to end-users.
  7. func ListVersions(c *gophercloud.ServiceClient) pagination.Pager {
  8. return pagination.NewPager(c, apiVersionsURL(c), func(r pagination.PageResult) pagination.Page {
  9. return APIVersionPage{pagination.SinglePageBase(r)}
  10. })
  11. }
  12. // ListVersionResources lists all of the different API resources for a
  13. // particular API versions. Typical resources for Neutron might be: networks,
  14. // subnets, etc.
  15. func ListVersionResources(c *gophercloud.ServiceClient, v string) pagination.Pager {
  16. return pagination.NewPager(c, apiInfoURL(c, v), func(r pagination.PageResult) pagination.Page {
  17. return APIVersionResourcePage{pagination.SinglePageBase(r)}
  18. })
  19. }