aiflavors

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAIFlavorsInto

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

func List

List retrieves list of AI flavors

Types

type AIFlavor

type AIFlavor struct {
	FlavorID            string               `json:"flavor_id"`
	FlavorName          string               `json:"flavor_name"`
	Disabled            bool                 `json:"disabled"`
	ResourceClass       string               `json:"resource_class"`
	PriceStatus         *string              `json:"price_status,omitempty"`
	CurrencyCode        *gcorecloud.Currency `json:"currency_code,omitempty"`
	PricePerHour        *decimal.Decimal     `json:"price_per_hour,omitempty"`
	PricePerMonth       *decimal.Decimal     `json:"price_per_month,omitempty"`
	HardwareDescription *HardwareDescription `json:"hardware_description,omitempty"`
	RAM                 *int                 `json:"ram,omitempty"`
	VCPUS               *int                 `json:"vcpus,omitempty"`
	Capacity            *int                 `json:"capacity,omitempty"`
}

Flavor represents a flavor structure.

func ExtractAIFlavors

func ExtractAIFlavors(r pagination.Page) ([]AIFlavor, error)

ExtractFlavor 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, opts ListOptsBuilder) ([]AIFlavor, error)

ListAll retrieves list of all AI flavors

type AIFlavorListOpts

type AIFlavorListOpts struct {
	Disabled        bool `q:"disabled"`
	IncludeCapacity bool `q:"include_capacity"`
	IncludePrices   bool `q:"include_prices"`
}

func (AIFlavorListOpts) ToAIFlavorListQuery

func (opts AIFlavorListOpts) ToAIFlavorListQuery() (string, error)

ToAIFlavorListQuery formats a AIFlavorListOpts into a query string.

type AIFlavorPage

type AIFlavorPage struct {
	pagination.LinkedPageBase
}

AIFlavorPage is the page returned by a pager when traversing over a collection of instances.

func (AIFlavorPage) IsEmpty

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

IsEmpty checks whether a FlavorPage struct is empty.

func (AIFlavorPage) NextPageURL

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

NextPageURL is invoked when a paginated collection of 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 {
	CPU         string `json:"cpu,omitempty"`
	Disk        string `json:"disk,omitempty"`
	Network     string `json:"network,omitempty"`
	RAM         string `json:"ram,omitempty"`
	Ephemeral   string `json:"ephemeral,omitempty"`
	GPU         string `json:"gpu,omitempty"`
	IPU         string `json:"ipu,omitempty"`
	PoplarCount string `json:"poplar_count,omitempty"`
	SGXEPCSize  string `json:"sgx_epc_size,omitempty"`
}

type ListOptsBuilder

type ListOptsBuilder interface {
	ToAIFlavorListQuery() (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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