blob: 8755a95b8f912794096f0d46b67eccba6d54b7ac [file] [log] [blame]
Jon Perritt23e89c32015-01-19 15:39:45 -07001package flavors
2
3import (
Jon Perritt23e89c32015-01-19 15:39:45 -07004 "github.com/rackspace/gophercloud"
5 "github.com/rackspace/gophercloud/pagination"
6)
7
8// List returns a single page of CDN flavors.
9func List(c *gophercloud.ServiceClient) pagination.Pager {
10 url := listURL(c)
11 createPage := func(r pagination.PageResult) pagination.Page {
12 return FlavorPage{pagination.SinglePageBase(r)}
13 }
14 return pagination.NewPager(c, url, createPage)
15}
16
17// Get retrieves a specific flavor based on its unique ID.
18func Get(c *gophercloud.ServiceClient, id string) GetResult {
19 var res GetResult
Jamie Hannaford22aa42b2015-03-24 14:56:04 +010020 _, res.Err = c.Get(getURL(c, id), &res.Body, nil)
Jon Perritt23e89c32015-01-19 15:39:45 -070021 return res
22}