v0.9.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2016 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0



Package flavors provides information and interaction with the flavor API resource for the Rackspace Cloud Servers service.



This section is empty.


This section is empty.


func ListDetail

func ListDetail(client *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager

ListDetail enumerates the server images available to your account.


type ExtraSpecs

type ExtraSpecs struct {
	// The number of data disks
	NumDataDisks int `mapstructure:"number_of_data_disks"`
	// The flavor class
	Class string `mapstructure:"class"`
	// Relative measure of disk I/O performance from 0-99, where higher is faster
	DiskIOIndex int    `mapstructure:"disk_io_index"`
	PolicyClass string `mapstructure:"policy_class"`

ExtraSpecs provide additional information about the flavor.

type Flavor

type Flavor struct {
	// The Id field contains the flavor's unique identifier.
	// For example, this identifier will be useful when specifying which hardware configuration to use for a new server instance.
	ID string `mapstructure:"id"`

	// The Disk and RA< fields provide a measure of storage space offered by the flavor, in GB and MB, respectively.
	Disk int `mapstructure:"disk"`
	RAM  int `mapstructure:"ram"`

	// The Name field provides a human-readable moniker for the flavor.
	Name string `mapstructure:"name"`

	RxTxFactor float64 `mapstructure:"rxtx_factor"`

	// Swap indicates how much space is reserved for swap.
	// If not provided, this field will be set to 0.
	Swap int `mapstructure:"swap"`

	// VCPUs indicates how many (virtual) CPUs are available for this flavor.
	VCPUs int `mapstructure:"vcpus"`

	// ExtraSpecs provides extra information about the flavor
	ExtraSpecs ExtraSpecs `mapstructure:"OS-FLV-WITH-EXT-SPECS:extra_specs"`

Flavor records represent (virtual) hardware configurations for server resources in a region.

func ExtractFlavors

func ExtractFlavors(page pagination.Page) ([]Flavor, error)

ExtractFlavors provides access to the list of flavors in a page acquired from the List operation.

type GetResult

type GetResult struct {

GetResult temporarily holds the response from a Get call.

func Get

func Get(client *gophercloud.ServiceClient, id string) GetResult

Get returns details about a single flavor, identity by ID.

func (GetResult) Extract

func (gr GetResult) Extract() (*Flavor, error)

Extract provides access to the individual Flavor returned by the Get function.

type ListOpts

type ListOpts struct {

	// MinDisk and MinRAM, if provided, elide flavors that do not meet your criteria.
	MinDisk int `q:"minDisk"`
	MinRAM  int `q:"minRam"`

	// Marker specifies the ID of the last flavor in the previous page.
	Marker string `q:"marker"`

	// Limit instructs List to refrain from sending excessively large lists of flavors.
	Limit int `q:"limit"`

ListOpts helps control the results returned by the List() function. For example, a flavor with a minDisk field of 10 will not be returned if you specify MinDisk set to 20.

func (ListOpts) ToFlavorListQuery

func (opts ListOpts) ToFlavorListQuery() (string, error)

ToFlavorListQuery formats a ListOpts into a query string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL