blob: 048872ae8224e2921d009819e9b5f3f472384b85 [file] [log] [blame]
Jamie Hannaford05d200d2015-02-20 14:49:05 +01001// +build acceptance db
2
3package v1
4
5import (
6 "github.com/rackspace/gophercloud/openstack/db/v1/flavors"
7 "github.com/rackspace/gophercloud/pagination"
8)
9
10func (c context) listFlavors() {
11 c.Logf("Listing flavors")
12
Jamie Hannaford11108402015-02-23 10:31:41 +010013 err := flavors.List(c.client).EachPage(func(page pagination.Page) (bool, error) {
14 flavorList, err := flavors.ExtractFlavors(page)
Jamie Hannaford05d200d2015-02-20 14:49:05 +010015 c.AssertNoErr(err)
16
17 for _, f := range flavorList {
18 c.Logf("Flavor: %#v", f)
19 }
20
21 return true, nil
22 })
23
Jamie Hannaford11108402015-02-23 10:31:41 +010024 c.AssertNoErr(err)
Jamie Hannaford05d200d2015-02-20 14:49:05 +010025}
26
27func (c context) getFlavor() {
Jamie Hannaford18b45ed2015-02-23 12:54:10 +010028 flavor, err := flavors.Get(c.client, "1").Extract()
Jamie Hannaford05d200d2015-02-20 14:49:05 +010029 c.Logf("Getting flavor %s", flavor.ID)
Jamie Hannaford11108402015-02-23 10:31:41 +010030 c.AssertNoErr(err)
Jamie Hannaford05d200d2015-02-20 14:49:05 +010031}