image

package
v0.0.0-...-69eda68 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: MPL-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageMap map[string]*ImageData = make(map[string]*ImageData)

Functions

func SaveImage

func SaveImage(name string, image *ImageData)

Types

type Client

type Client struct {
	*client.Client
}

func Session

func Session(c *client.Client) *Client

func (*Client) AllocateImage

func (c *Client) AllocateImage(image *ImageData, datastoreID int) error

AllocateImage allocates an image in OpenNebula

func (*Client) CheckImageExistence

func (c *Client) CheckImageExistence(name string) (*ImageData, error)

func (*Client) DeleteImage

func (c *Client) DeleteImage(imgID int) error

func (*Client) FetchDatastore

func (c *Client) FetchDatastore(req *Request) (*Datastore, error)

func (*Client) FetchImage

func (c *Client) FetchImage(req *Request) (*ImageData, error)

func (*Client) GetImageState

func (c *Client) GetImageState(imID int) (*ImageData, error)

func (*Client) WaitForUnused

func (c *Client) WaitForUnused(imID, tries, duration int, unit time.Duration) error

type Datastore

type Datastore struct {
	ID   int    `xml:"ID"`
	Name string `xml:"NAME"`
}

type DatastorePool

type DatastorePool struct {
	XMLName    xml.Name    `xml:"DATASTORE_POOL"`
	Datastores []Datastore `xml:"DATASTORE"`
}

type ImageData

type ImageData struct {
	XMLName        xml.Name `xml:"IMAGE"`
	Name           string   `xml:"NAME"`
	ID             int      `xml:"ID,omitempty"`
	Description    string
	Type           string
	Persistent     ImagePersistentEnum `xml:"PERSISTENT"`
	PersistentType string
	DevPrefix      string
	Target         string
	Driver         string
	Path           string
	Source         string
	DiskType       string
	AdapterType    string
	ReadOnly       bool
	Md5            string
	Sha1           string
	Size           int `xml:"SIZE"`
	RunningVMs     int `xml:"RUNNING_VMS,omitempty"`
}

func GetImage

func GetImage(name string) *ImageData

type ImagePersistentEnum

type ImagePersistentEnum string
const (
	ImagePersistentYES ImagePersistentEnum = "YES"
	ImagePersistentNO  ImagePersistentEnum = "NO"
)

type ImagePool

type ImagePool struct {
	XMLName xml.Name    `xml:"IMAGE_POOL"`
	Images  []ImageData `xml:"IMAGE"`
}

type Request

type Request struct {
	SpecificID   *int
	SpecificName *string
	ImageFilter  *int
}

Jump to

Keyboard shortcuts

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