datastore

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: 1

Documentation

Index

Constants

View Source
const (
	// Ready datastore is ready
	Ready = iota

	// Disable datastore is disabled
	Disable
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	XMLName     xml.Name            `xml:"DATASTORE"`
	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"`
	Permissions *shared.Permissions `xml:"PERMISSIONS,omitempty"`
	DSMad       string              `xml:"DS_MAD,omitempty"`
	TMMad       string              `xml:"TM_MAD,omitempty"`
	BasePath    string              `xml:"BASE_PATH,omitempty"`
	Type        string              `xml:"TYPE,omitempty"`
	DiskType    string              `xml:"DISK_TYPE,omitempty"`
	StateRaw    int                 `xml:"STATE,omitempty"`
	Clusters    shared.EntitiesID   `xml:"CLUSTERS,omitempty"`
	TotalMB     int                 `xml:"TOTAL_MB,omitempty"`
	FreeMB      int                 `xml:"FREE_MB,omitempty"`
	UsedMB      int                 `xml:"USED_MB,omitempty"`
	Images      shared.EntitiesID   `xml:"IMAGES,omitempty"`
	Template    Template            `xml:"TEMPLATE,omitempty"`
}

Datastore represents an OpenNebula Datastore

func (*Datastore) State

func (datastore *Datastore) State() (State, error)

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

func (*Datastore) StateString

func (datastore *Datastore) StateString() (string, error)

StateString returns the state in string format

type Pool

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

Pool represents an OpenNebula Datastore pool

type State

type State int

State is the state of an OpenNebula datastore

func (State) String

func (s State) String() string

type Template

type Template struct {
	dyn.Template
}

Template is a datastore template

func NewTemplate

func NewTemplate() *Template

NewTemplate returns a new datastore Template object

func (*Template) Add

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

Add adds an datastore key, value pair

func (*Template) Get

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

Get returns the string value for an datastore keys

func (*Template) GetI

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

GetI returns the integer value for a datastore template key

func (*Template) SetType

func (t *Template) SetType(typ Types)

SetType set a Datastore type

type Types

type Types string
const (
	System Types = "SYSTEM"
	Image  Types = "IMAGE"
	File   Types = "FILE"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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