Documentation ¶
Index ¶
- func Create(client *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
- 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 List(client *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type GetResult
- type Image
- type ImagePage
- type ImageTaskResult
- type ListOpts
- type ListOptsBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(client *gcorecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)
Create an image.
func Delete ¶
func Delete(client *gcorecloud.ServiceClient, imageID string) (r tasks.Result)
Delete an image.
func ExtractImagesInto ¶
func ExtractImagesInto(r pagination.Page, v interface{}) error
func List ¶
func List(client *gcorecloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
Types ¶
type CreateOpts ¶
type CreateOpts struct { URL string `json:"url" required:"true" validate:"required,url"` Name string `json:"name" required:"true" validate:"required"` CowFormat bool `json:"cow_format,omitempty"` Properties *map[string]string `json:"properties,omitempty"` }
CreateOpts represents options used to create a image.
func (CreateOpts) ToImageCreateMap ¶
func (opts CreateOpts) ToImageCreateMap() (map[string]interface{}, error)
ToImageCreateMap builds a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
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, id string) (r GetResult)
Get retrieves a specific image based on its unique 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"` Description string `json:"description"` Status string `json:"status"` Tags []string `json:"tags"` Visibility string `json:"visibility"` MinDisk int `json:"min_disk"` MinRAM int `json:"min_ram"` OsDistro string `json:"os_distro"` OsVersion string `json:"os_version"` DisplayOrder int `json:"display_order"` CreatedAt gcorecloud.JSONRFC3339Z `json:"created_at"` UpdatedAt *gcorecloud.JSONRFC3339Z `json:"updated_at"` Size int `json:"size"` CreatorTaskID *string `json:"creator_task_id"` TaskID *string `json:"task_id"` Region string `json:"region"` DiskFormat string `json:"disk_format"` }
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.
func ListAll ¶
func ListAll(client *gcorecloud.ServiceClient, opts ListOptsBuilder) ([]Image, error)
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 ListOpts ¶
type ListOpts struct { Private bool `q:"private"` Visibility types.Visibility `q:"visibility"` }
ListOpts allows the filtering and sorting of paginated collections through the API.
func (ListOpts) ToImageListQuery ¶
ToImageListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.