github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/bms/v1/flavors/requests.go (about)

     1  package flavors
     2  
     3  import (
     4  	"github.com/chnsz/golangsdk"
     5  )
     6  
     7  // ListOpts allows the filtering flavors through the API.
     8  type ListOpts struct {
     9  	// Specifies the availability_zone, e.g. cn-north-1a
    10  	AvailabilityZone string `q:"availability_zone"`
    11  }
    12  
    13  // List BMS flavors
    14  func List(c *golangsdk.ServiceClient, opts ListOpts) (r ListResult) {
    15  	q, err := golangsdk.BuildQueryString(opts)
    16  	if err != nil {
    17  		r.Err = err
    18  		return
    19  	}
    20  
    21  	url := listURL(c) + q.String()
    22  	_, r.Err = c.Get(url, &r.Body, nil)
    23  
    24  	return
    25  }