lbflavors

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFlavorsInto

func ExtractFlavorsInto(r pagination.Page, v interface{}) error

Types

type Flavor

type Flavor struct {
	PricePerMonth       float64             `json:"price_per_month,omitempty"`
	ResourceClass       string              `json:"resource_class,omitempty"`
	VCPUs               int                 `json:"vcpus,omitempty"`
	FlavorName          string              `json:"flavor_name,omitempty"`
	HardwareDescription HardwareDescription `json:"hardware_description"`
	CurrencyCode        string              `json:"currency_code,omitempty"`
	PriceStatus         string              `json:"price_status,omitempty"`
	PricePerHour        float64             `json:"price_per_hour,omitempty"`
	RAM                 int                 `json:"ram,omitempty"`
	FlavorID            string              `json:"flavor_id,omitempty"`
}

Flavor represent loadbalancer's flavor structure

func ExtractFlavors

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

ExtractFlavors accepts a Page struct, specifically a FlavorPage struct, and extracts the elements into a slice of Flavor structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

func ListAll(c *gcorecloud.ServiceClient) ([]Flavor, error)

ListAll returns all LB flavors

type FlavorPage

type FlavorPage struct {
	pagination.LinkedPageBase
}

FlavorPage is the page returned by a pager when traversing over a collection of loadbalancer flavors.

func (FlavorPage) IsEmpty

func (r FlavorPage) IsEmpty() (bool, error)

IsEmpty checks whether a FlavorPage struct is empty.

func (FlavorPage) NextPageURL

func (r FlavorPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of loadbalancer flavors has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type HardwareDescription

type HardwareDescription struct {
	SGXEPCSize string `json:"sgx_epc_size"`
	CPU        string `json:"cpu"`
	Disk       string `json:"disk"`
	Network    string `json:"network"`
	GPU        string `json:"gpu"`
	RAM        string `json:"ram"`
}

HardwareDescription represent flavor's hardware description structure

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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