apptemplates

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAppTemplatesInto

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

func List

List retrieves list of app templates

Types

type AppTemplate

type AppTemplate struct {
	ID               string                   `json:"id"`
	OsName           string                   `json:"os_name"`
	Developer        string                   `json:"developer"`
	OsVersion        string                   `json:"os_version"`
	Category         string                   `json:"category"`
	Website          string                   `json:"website"`
	MinVCPUs         *int                     `json:"min_vcpus"`
	DisplayName      string                   `json:"display_name"`
	ImageName        string                   `json:"image_name"`
	Usage            string                   `json:"usage"`
	Description      string                   `json:"description"`
	ShortDescription string                   `json:"short_description"`
	RegionID         *int                     `json:"region_id"`
	MinRam           int                      `json:"min_ram"`
	AppConfig        []map[string]interface{} `json:"app_config"`
	Version          string                   `json:"version"`
	MinDisk          int                      `json:"min_disk"`
}

func ExtractAppTemplates

func ExtractAppTemplates(r pagination.Page) ([]AppTemplate, error)

ExtractAppTemplates accepts a Page struct, specifically a AppTemplatePage struct, and extracts the elements into a slice of AppTemplate structs. In other words, a generic collection is mapped into a relevant slice.

func ListAll

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

ListAll retrieves list of app templates

type AppTemplatePage

type AppTemplatePage struct {
	pagination.LinkedPageBase
}

AppTemplatePage is the page returned by a pager when traversing over a collection of app templates.

func (AppTemplatePage) IsEmpty

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

IsEmpty checks whether a AppTemplatePage struct is empty.

func (AppTemplatePage) NextPageURL

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

NextPageURL is invoked when a paginated collection of app templates 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 GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a AppTemplate.

func Get

func Get(c *gcorecloud.ServiceClient, id string) (r GetResult)

Get retrieves a specific app template based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*AppTemplate, error)

Extract is a function that accepts a result and extracts a app template resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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