images

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2014 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package images provides information and interaction with the image API resource in the OpenStack Compute service.

An image is a collection of files used to create or rebuild a server. Operators provide a number of pre-built OS images by default. You may also create custom images from cloud servers you have launched.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDetail

func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

ListDetail enumerates the available images.

Types

type GetResult

type GetResult struct {
	gophercloud.Result
}

GetResult temporarily stores a Get response.

func Get

func Get(client *gophercloud.ServiceClient, id string) GetResult

Get acquires additional detail about a specific image by ID. Use ExtractImage() to interpret the result as an openstack Image.

func (GetResult) Extract

func (gr GetResult) Extract() (*Image, error)

Extract interprets a GetResult as an Image.

type Image

type Image struct {
	// ID contains the image's unique identifier.
	ID string

	Created string

	// MinDisk and MinRAM specify the minimum resources a server must provide to be able to install the image.
	MinDisk int
	MinRAM  int

	// Name provides a human-readable moniker for the OS image.
	Name string

	// The Progress and Status fields indicate image-creation status.
	// Any usable image will have 100% progress.
	Progress int
	Status   string

	Updated string
}

Image is used for JSON (un)marshalling. It provides a description of an OS image.

func ExtractImages

func ExtractImages(page pagination.Page) ([]Image, error)

ExtractImages converts a page of List results into a slice of usable Image structs.

type ImagePage

type ImagePage struct {
	pagination.LinkedPageBase
}

ImagePage contains a single page of results from a List operation. Use ExtractImages to convert it into a slice of usable structs.

func (ImagePage) IsEmpty

func (page ImagePage) IsEmpty() (bool, error)

IsEmpty returns true if a page contains no Image results.

func (ImagePage) NextPageURL

func (page ImagePage) NextPageURL() (string, error)

NextPageURL uses the response's embedded link reference to navigate to the next page of results.

type ListOpts

type ListOpts struct {
	// When the image last changed status (in date-time format).
	ChangesSince string `q:"changes-since"`
	// The number of Images to return.
	Limit int `q:"limit"`
	// UUID of the Image at which to set a marker.
	Marker string `q:"marker"`
	// The name of the Image.
	Name string `q:"name:"`
	// The name of the Server (in URL format).
	Server string `q:"server"`
	// The current status of the Image.
	Status string `q:"status"`
	// The value of the type of image (e.g. BASE, SERVER, ALL)
	Type string `q:"type"`
}

ListOpts contain options for limiting the number of Images returned from a call to ListDetail.

func (ListOpts) ToImageListQuery

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

ToImageListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

Jump to

Keyboard shortcuts

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