image

package
v0.0.0-...-884d9dc Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	XMLName        xml.Name            `xml:"IMAGE"`
	ID             int                 `xml:"ID,omitempty"`
	UID            int                 `xml:"UID,omitempty"`
	GID            int                 `xml:"GID,omitempty"`
	UName          string              `xml:"UNAME,omitempty"`
	GName          string              `xml:"GNAME,omitempty"`
	Name           string              `xml:"NAME"`
	LockInfos      *shared.Lock        `xml:"LOCK,omitempty"`
	Permissions    *shared.Permissions `xml:"PERMISSIONS,omitempty"`
	Type           string              `xml:"TYPE,omitempty"`
	DiskType       *int                `xml:"DISK_TYPE,omitempty"`
	Persistent     *int                `xml:"PERSISTENT,omitempty"`
	RegTime        int                 `xml:"REGTIME,omitempty"`
	Source         string              `xml:"SOURCE,omitempty"`
	Path           string              `xml:"PATH,omitempty"`
	Fs             string              `xml:"FS,omitempty"`
	Driver         string              `xml:"DRIVER,omitempty"`
	Format         string              `xml:"FORMAT,omitempty"`
	Size           int                 `xml:"SIZE,omitempty"`
	StateRaw       int                 `xml:"STATE,omitempty"`
	RunningVMs     int                 `xml:"RUNNING_VMS,omitempty"`
	CloningOps     int                 `xml:"CLONING_OPS,omitempty"`
	CloningID      int                 `xml:"CLONING_ID,omitempty"`
	TargetSnapshot int                 `xml:"TARGET_SNAPSHOT,omitempty"`
	DatastoreID    *int                `xml:"DATASTORE_ID,omitempty"`
	Datastore      string              `xml:"DATASTORE,omitempty"`
	VMs            shared.EntitiesID   `xml:"VMS,omitempty"`
	Clones         shared.EntitiesID   `xml:"CLONES,omitempty"`
	AppClones      shared.EntitiesID   `xml:"APP_CLONES,omitempty"`
	Snapshots      shared.DiskSnapshot `xml:"SNAPSHOTS,omitempty"`
	Template       Template            `xml:"TEMPLATE"`
}

Image represents an OpenNebula Image

func (*Image) State

func (image *Image) State() (State, error)

State looks up the state of the image and returns the State

func (*Image) StateString

func (image *Image) StateString() (string, error)

StateString returns the state in string format

type Pool

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

Pool represents an OpenNebula Image pool

type State

type State int

State is the state of the Image

const (
	// Init image is being initialized
	Init State = iota

	// Ready image is ready to be used
	Ready

	// Used image is in use
	Used

	// Disabled image is in disabled
	Disabled

	// Locked image is locked
	Locked

	// Error image is in error state
	Error

	// Clone image is in clone state
	Clone

	// Delete image is in delete state
	Delete

	// UsedPers image is in use and persistent
	UsedPers

	// LockUsed image is in locked state (non-persistent)
	LockUsed

	// LockUsedPers image is in locked state (persistent)
	LockUsedPers
)

func (State) String

func (s State) String() string

String returns the string version of the State

type Template

type Template struct {
	dyn.Template
}

Template is the dynamic part of the image entity

func NewTemplate

func NewTemplate() *Template

NewTemplate returns an image template

func (*Template) Add

func (t *Template) Add(key keys.Template, value interface{})

Add adds an image template key, value pair

func (*Template) Get

func (t *Template) Get(key keys.Template) (string, error)

Get return the string value of a template image key

func (*Template) GetI

func (n *Template) GetI(key keys.Template) (int, error)

GetI returns the integer value for an image template key

func (*Template) SetType

func (t *Template) SetType(typ Types)

SetType set an Image type

type Types

type Types string

Types is a type used to enumerate image types

const (
	// Virtual Machine disks
	Datablock Types = "DATABLOCK"
	CDRom     Types = "CDROM"
	OS        Types = "OS"

	// File types, can be registered only in File Datastores
	Kernel  Types = "KERNEL"
	RamDisk Types = "RAMDISK"
	Context Types = "CONTEXT"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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