blob: 43445bce661315bb3a6d8df4a9829abb2d9b8835 [file] [log] [blame]
Jamie Hannaford5b7acc12015-02-13 09:14:25 +01001package 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"
Jamie Hannaford5b7acc12015-02-13 09:14:25 +01006)
7
Jamie Hannaford9793d942015-02-18 15:13:20 +01008// List will list all available hardware flavors that an instance can use. The
9// operation is identical to the one supported by the Nova API, but without the
10// "disk" property.
Jamie Hannaford5b7acc12015-02-13 09:14:25 +010011func List(client *gophercloud.ServiceClient) pagination.Pager {
Jon Perrittdb0ae142016-03-13 00:33:41 -060012 return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
Jamie Hannaford5b7acc12015-02-13 09:14:25 +010013 return FlavorPage{pagination.LinkedPageBase{PageResult: r}}
Jon Perrittdb0ae142016-03-13 00:33:41 -060014 })
Jamie Hannaford5b7acc12015-02-13 09:14:25 +010015}
16
Jamie Hannaford9793d942015-02-18 15:13:20 +010017// Get will retrieve information for a specified hardware flavor.
Jon Perritt3860b512016-03-29 12:01:48 -050018func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
Jon Perrittdb0ae142016-03-13 00:33:41 -060019 _, r.Err = client.Get(getURL(client, id), &r.Body, nil)
jrperritt29ae6b32016-04-13 12:59:37 -050020 return
Jamie Hannaford5b7acc12015-02-13 09:14:25 +010021}