github.com/vnpaycloud-console/gophercloud/v2@v2.0.5/openstack/db/v1/flavors/requests.go (about)

     1  package flavors
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/vnpaycloud-console/gophercloud/v2"
     7  	"github.com/vnpaycloud-console/gophercloud/v2/pagination"
     8  )
     9  
    10  // List will list all available hardware flavors that an instance can use. The
    11  // operation is identical to the one supported by the Nova API, but without the
    12  // "disk" property.
    13  func List(client *gophercloud.ServiceClient) pagination.Pager {
    14  	return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page {
    15  		return FlavorPage{pagination.LinkedPageBase{PageResult: r}}
    16  	})
    17  }
    18  
    19  // Get will retrieve information for a specified hardware flavor.
    20  func Get(ctx context.Context, client *gophercloud.ServiceClient, id string) (r GetResult) {
    21  	resp, err := client.Get(ctx, getURL(client, id), &r.Body, nil)
    22  	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
    23  	return
    24  }