blob: d42d1d7721963f07834135a5ec84316cd9771524 [file] [log] [blame]
Jon Perritt23e89c32015-01-19 15:39:45 -07001package flavors
2
3import (
Jon Perritt27249f42016-02-18 10:35:59 -06004 "github.com/gophercloud/gophercloud"
5 "github.com/gophercloud/gophercloud/pagination"
Jon Perritt23e89c32015-01-19 15:39:45 -07006)
7
8// List returns a single page of CDN flavors.
9func List(c *gophercloud.ServiceClient) pagination.Pager {
Jon Perrittdb0ae142016-03-13 00:33:41 -060010 return pagination.NewPager(c, listURL(c), func(r pagination.PageResult) pagination.Page {
Jon Perritt23e89c32015-01-19 15:39:45 -070011 return FlavorPage{pagination.SinglePageBase(r)}
Jon Perrittdb0ae142016-03-13 00:33:41 -060012 })
Jon Perritt23e89c32015-01-19 15:39:45 -070013}
14
15// Get retrieves a specific flavor based on its unique ID.
16func Get(c *gophercloud.ServiceClient, id string) GetResult {
Jon Perrittdb0ae142016-03-13 00:33:41 -060017 var r GetResult
18 _, r.Err = c.Get(getURL(c, id), &r.Body, nil)
19 return r
Jon Perritt23e89c32015-01-19 15:39:45 -070020}