blob: d6cb09349d55e963dcc5bbc048ba12df41e2fbf0 [file] [log] [blame]
Jon Perritt23e89c32015-01-19 15:39:45 -07001package flavors
2
3import (
Krzysztof Szukiełojć3f41d082017-05-07 14:43:06 +02004 "gerrit.mcp.mirantis.net/debian/gophercloud.git"
Krzysztof Szukiełojć24a29ce2017-05-07 14:24:02 +02005 "gerrit.mcp.mirantis.net/debian/gophercloud.git/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}