flavors

package
v0.29.3-dev Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlavorsURL

func FlavorsURL(c *gcorecloud.ServiceClient) string

FlavorsURL returns URL for GPU flavors operations

func FormatGPU

func FormatGPU(model string, count int, memory int) string

FormatGPU formats GPU information according to the formula

func ListBaremetal

func ListBaremetal(client *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

ListBaremetal retrieves list of baremetal GPU flavors

func ListVirtual

func ListVirtual(client *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

ListVirtual retrieves list of virtual GPU flavors

Types

type BMFlavor

type BMFlavor struct {
	ID                  string                 `json:"id"`
	Name                string                 `json:"name"`
	CPU                 string                 `json:"cpu"`
	RAM                 int                    `json:"ram"`
	Disk                string                 `json:"disk"`
	Network             string                 `json:"network"`
	GPU                 string                 `json:"gpu"`
	Price               *Price                 `json:"price"`
	Architecture        *string                `json:"architecture"`
	Disabled            bool                   `json:"disabled"`
	Capacity            int                    `json:"capacity"`
	HardwareDescription map[string]interface{} `json:"hardware_description"`
	HardwareProperties  *HardwareProperties    `json:"hardware_properties"`
	SupportedFeatures   *SupportedFeatures     `json:"supported_features"`
}

BMFlavor represents a baremetal GPU flavor

func ExtractBMFlavors

func ExtractBMFlavors(r pagination.Page) ([]BMFlavor, error)

ExtractBMFlavors extracts baremetal flavors

type FlavorPage

type FlavorPage struct {
	pagination.LinkedPageBase
}

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

func (FlavorPage) IsEmpty

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

IsEmpty checks whether a FlavorPage struct is empty.

type GPUInfo

type GPUInfo struct {
	Model  string `json:"model"`
	Count  int    `json:"count"`
	Memory int    `json:"memory"`
}

GPUInfo represents GPU related information

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation.

type HardwareProperties

type HardwareProperties struct {
	GPUModel        *string `json:"gpu_model"`
	GPUManufacturer *string `json:"gpu_manufacturer"`
	GPUCount        *int    `json:"gpu_count"`
}

HardwareProperties represents GPU hardware properties

type ListOpts

type ListOpts struct {
	// IncludePrices true to include prices in the response, defaults to false
	IncludePrices *bool `q:"include_prices"`
	// HideDisabled true to hide disabled flavors, defaults to false
	HideDisabled *bool `q:"hide_disabled"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToFlavorListQuery

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

ToFlavorListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

type Price

type Price struct {
	CurrencyCode  *string             `json:"currency_code"`
	PricePerHour  *decimal.Decimal    `json:"price_per_hour"`
	PricePerMonth *decimal.Decimal    `json:"price_per_month"`
	PriceStatus   *PriceDisplayStatus `json:"price_status"`
}

Price represents a flavor price structure

type PriceDisplayStatus

type PriceDisplayStatus string

PriceDisplayStatus represents the status of price display

const (
	PriceStatusShow  PriceDisplayStatus = "show"
	PriceStatusHide  PriceDisplayStatus = "hide"
	PriceStatusError PriceDisplayStatus = "error"
)

type SupportedFeatures added in v0.24.0

type SupportedFeatures struct {
	SecurityGroups bool `json:"security_groups"`
}

SupportedFeatures represents the set of enabled features based on the flavor's type and configuration

type VMFlavor

type VMFlavor struct {
	ID                  string                 `json:"id"`
	Name                string                 `json:"name"`
	VCPUs               int                    `json:"vcpus"`
	RAM                 int                    `json:"ram"`
	Price               *Price                 `json:"price"`
	Architecture        *string                `json:"architecture"`
	Disabled            bool                   `json:"disabled"`
	Capacity            int                    `json:"capacity"`
	GPU                 string                 `json:"gpu"`
	HardwareDescription map[string]interface{} `json:"hardware_description"`
	HardwareProperties  *HardwareProperties    `json:"hardware_properties"`
	SupportedFeatures   *SupportedFeatures     `json:"supported_features"`
}

VMFlavor represents a virtual GPU flavor

func ExtractVMFlavors

func ExtractVMFlavors(r pagination.Page) ([]VMFlavor, error)

ExtractVMFlavors extracts virtual machine flavors

Jump to

Keyboard shortcuts

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