Documentation
¶
Index ¶
- Constants
- func Delete(client *gcorecloud.ServiceClient, imageID string) (r tasks.Result)
- func ExtractImageIDFromTask(task *tasks.Task) (string, error)
- func ExtractImagesInto(r pagination.Page, v interface{}) error
- func ImageURL(c *gcorecloud.ServiceClient, imageID string) string
- func ImagesURL(c *gcorecloud.ServiceClient) string
- func List(client *gcorecloud.ServiceClient) pagination.Pager
- func UploadImage(client *gcorecloud.ServiceClient, opts ImageOpts) (r tasks.Result)
- type CreateResult
- type GetResult
- type Image
- type ImageHwFirmwareType
- type ImageOpts
- type ImageOsType
- type ImagePage
- type ImageTaskResult
- type SshKeyType
- type UpdateResult
Constants ¶
const ( HwFirmwareTypeBios ImageHwFirmwareType = "bios" HwFirmwareTypeUefi ImageHwFirmwareType = "uefi" OsTypeLinux ImageOsType = "linux" OsTypeWindows ImageOsType = "windows" SshKeyAllow SshKeyType = "allow" SshKeyDeny SshKeyType = "deny" SshKeyRequired SshKeyType = "required" )
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(client *gcorecloud.ServiceClient, imageID string) (r tasks.Result)
Delete deletes a GPU image by ID
func ExtractImagesInto ¶
func ExtractImagesInto(r pagination.Page, v interface{}) error
func ImageURL ¶
func ImageURL(c *gcorecloud.ServiceClient, imageID string) string
ImageURL returns URL for specific GPU image operations
func ImagesURL ¶
func ImagesURL(c *gcorecloud.ServiceClient) string
ImagesURL returns URL for GPU images operations
func List ¶
func List(client *gcorecloud.ServiceClient) pagination.Pager
List retrieves list of GPU images
func UploadImage ¶
func UploadImage(client *gcorecloud.ServiceClient, opts ImageOpts) (r tasks.Result)
UploadImage uploads a new GPU image
Types ¶
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Image.
func (CreateResult) Extract ¶
Extract is a function that accepts a result and extracts a image resource.
func (CreateResult) ExtractInto ¶
func (r CreateResult) ExtractInto(v interface{}) error
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 Image.
func Get ¶
func Get(client *gcorecloud.ServiceClient, imageID string) (r GetResult)
Get retrieves a specific GPU image by ID
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts a image resource.
func (GetResult) ExtractInto ¶
func (r GetResult) ExtractInto(v interface{}) error
type Image ¶
type Image struct { ID string `json:"id"` Name string `json:"name"` Status string `json:"status"` MinDisk int `json:"min_disk"` MinRAM int `json:"min_ram"` Size int `json:"size"` Visibility string `json:"visibility"` Architecture string `json:"architecture"` CowFormat bool `json:"cow_format"` HwFirmwareType *ImageHwFirmwareType `json:"hw_firmware_type"` OsDistro *string `json:"os_distro"` OsType *ImageOsType `json:"os_type"` OsVersion *string `json:"os_version"` SshKey SshKeyType `json:"ssh_key"` URL string `json:"url"` CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"` CreatorTaskID *string `json:"creator_task_id"` TaskID *string `json:"task_id"` Metadata map[string]interface{} `json:"metadata"` }
func ExtractImages ¶
func ExtractImages(r pagination.Page) ([]Image, error)
ExtractImages accepts a Page struct, specifically a ImagePage struct, and extracts the elements into a slice of image structs. In other words, a generic collection is mapped into a relevant slice.
type ImageHwFirmwareType ¶
type ImageHwFirmwareType string
type ImageOpts ¶
type ImageOpts struct { // Image name Name string `json:"name" required:"true"` // Image URL URL string `json:"url" required:"true"` // Image architecture type: aarch64, x86_64 Architecture *string `json:"architecture,omitempty"` // When True, image cannot be deleted unless all volumes, created from it, are deleted. CowFormat *bool `json:"cow_format,omitempty"` // Specifies the type of firmware with which to boot the guest. HwFirmwareType *ImageHwFirmwareType `json:"hw_firmware_type,omitempty"` // Create one or more metadata items for a cluster Metadata map[string]interface{} `json:"metadata,omitempty"` // OS Distribution, i.e. Debian, CentOS, Ubuntu, CoreOS etc. OsDistro *string `json:"os_distro,omitempty"` // The operating system installed on the image. OsType *ImageOsType `json:"os_type,omitempty"` // OS version, i.e. 19.04 (for Ubuntu) or 9.4 for Debian OsVersion *string `json:"os_version,omitempty"` // Permission to use a ssh key in instances SshKey *SshKeyType `json:"ssh_key,omitempty"` }
ImageOpts represents common options for uploading GPU images.
func (ImageOpts) ToImageCreateMap ¶
ToImageCreateMap builds a request body from ImageOpts.
type ImageOsType ¶
type ImageOsType string
type ImagePage ¶
type ImagePage struct {
pagination.LinkedPageBase
}
ImagePage is the page returned by a pager when traversing over a collection of images.
func (ImagePage) NextPageURL ¶
NextPageURL is invoked when a paginated collection of images 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 ImageTaskResult ¶
type ImageTaskResult struct {
Images []string `json:"images"`
}
type SshKeyType ¶
type SshKeyType string
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of a update operation. Call its Extract method to interpret it as a Image.
func (UpdateResult) Extract ¶
Extract is a function that accepts a result and extracts a image resource.
func (UpdateResult) ExtractInto ¶
func (r UpdateResult) ExtractInto(v interface{}) error