github.com/gophercloud/gophercloud@v1.11.0/openstack/db/v1/flavors/requests.go (about)

     1  package flavors
     2  
     3  import (
     4  	"github.com/gophercloud/gophercloud"
     5  	"github.com/gophercloud/gophercloud/pagination"
     6  )
     7  
     8  // 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.
    11  func List(client *gophercloud.ServiceClient) pagination.Pager {
    12  	return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
    13  		return FlavorPage{pagination.LinkedPageBase{PageResult: r}}
    14  	})
    15  }
    16  
    17  // Get will retrieve information for a specified hardware flavor.
    18  func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
    19  	resp, err := client.Get(getURL(client, id), &r.Body, nil)
    20  	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
    21  	return
    22  }