aiimages

package
v0.6.28 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAIImagesInto

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

func List

List retrieves list of flavors

Types

type AIImage

type AIImage struct {
	ID            string                   `json:"id"`
	Name          string                   `json:"name"`
	Description   string                   `json:"description,omitempty"`
	Status        string                   `json:"status"`
	Visibility    string                   `json:"visibility"`
	MinDisk       int                      `json:"min_disk"`
	MinRAM        int                      `json:"min_ram"`
	OsDistro      string                   `json:"os_distro"`
	OsType        string                   `json:"os_type"`
	OsVersion     string                   `json:"os_version"`
	DisplayOrder  int                      `json:"display_order,omitempty"`
	CreatedAt     gcorecloud.JSONRFC3339Z  `json:"created_at"`
	UpdatedAt     *gcorecloud.JSONRFC3339Z `json:"updated_at"`
	SshKey        string                   `json:"ssh_key,omitempty"`
	Size          int                      `json:"size"`
	CreatorTaskID *string                  `json:"creator_task_id,omitempty"`
	TaskID        *string                  `json:"task_id"`
	Region        string                   `json:"region"`
	RegionID      int                      `json:"region_id"`
	ProjectID     int                      `json:"project_id"`
	DiskFormat    string                   `json:"disk_format"`
	IsBaremetal   bool                     `json:"is_baremetal,omitempty"`
	HwFirmareType string                   `json:"hw_firmware_type,omitempty"`
	HwMachineType string                   `json:"hw_machine_type,omitempty"`
	Architecture  string                   `json:"architecture,omitempty"`
	Metadata      []metadata.Metadata      `json:"metadata_detailed"`
}

func ExtractAIImages

func ExtractAIImages(r pagination.Page) ([]AIImage, 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) ([]AIImage, error)

ListAll retrieves list of flavors

type AIImageListOpts

type AIImageListOpts struct {
	Visibility string            `q:"visibility" validate:"omitempty,enum"`
	Private    string            `q:"private" validate:"omitempty"`
	MetadataK  string            `q:"metadata_k" validate:"omitempty"`
	MetadataKV map[string]string `q:"metadata_kv" validate:"omitempty"`
}

func (AIImageListOpts) ToAIImageListQuery

func (opts AIImageListOpts) ToAIImageListQuery() (string, error)

ToFlavorListQuery formats a ListOpts into a query string.

type AIImagePage

type AIImagePage struct {
	pagination.LinkedPageBase
}

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

func (AIImagePage) IsEmpty

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

IsEmpty checks whether a FlavorPage struct is empty.

func (AIImagePage) NextPageURL

func (r AIImagePage) 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 ListOptsBuilder

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

type VisibilityType

type VisibilityType string
const (
	PRIVATE VisibilityType = "private"
	PUBLIC  VisibilityType = "public"
	SHARED  VisibilityType = "shared"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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