blob: 1977fe365a6686b593315bf7745b612b94bd1a41 [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.
Jon Perritt3860b512016-03-29 12:01:48 -050016func Get(c *gophercloud.ServiceClient, id string) (r GetResult) {
Jon Perrittdb0ae142016-03-13 00:33:41 -060017 _, r.Err = c.Get(getURL(c, id), &r.Body, nil)
jrperritt29ae6b32016-04-13 12:59:37 -050018 return
Jon Perritt23e89c32015-01-19 15:39:45 -070019}