Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 1 | package flavors |
| 2 | |
| 3 | import ( |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 4 | "github.com/gophercloud/gophercloud" |
| 5 | "github.com/gophercloud/gophercloud/pagination" |
Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 6 | ) |
| 7 | |
| 8 | // List returns a single page of CDN flavors. |
| 9 | func List(c *gophercloud.ServiceClient) pagination.Pager { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame^] | 10 | return pagination.NewPager(c, listURL(c), func(r pagination.PageResult) pagination.Page { |
Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 11 | return FlavorPage{pagination.SinglePageBase(r)} |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame^] | 12 | }) |
Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | // Get retrieves a specific flavor based on its unique ID. |
| 16 | func Get(c *gophercloud.ServiceClient, id string) GetResult { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame^] | 17 | var r GetResult |
| 18 | _, r.Err = c.Get(getURL(c, id), &r.Body, nil) |
| 19 | return r |
Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 20 | } |