Documentation ¶
Index ¶
Constants ¶
const ( DiskVec string = "DISK" DevPrefix DiskKeys = "DEV_PREFIX" Cache DiskKeys = "CACHE" Discard DiskKeys = "DISCARD" IO DiskKeys = "IO" DiskID DiskKeys = "DISK_ID" Datastore DiskKeys = "DATASTORE" DatastoreID DiskKeys = "DATASTORE_ID" DiskType DiskKeys = "DISK_TYPE" Driver DiskKeys = "DRIVER" Image DiskKeys = "IMAGE" ImageID DiskKeys = "IMAGE_ID" ImageUname DiskKeys = "IMAGE_UNAME" OriginalSize DiskKeys = "ORIGINAL_SIZE" Size DiskKeys = "SIZE" TargetDisk DiskKeys = "TARGET" )
Some keys are specific to VM some others to VRouter
const ( NICVec string = "NIC" NICID NICKeys = "NIC_ID" Bridge NICKeys = "BRIDGE" Filter NICKeys = "FILTER" IP NICKeys = "IP" MAC NICKeys = "MAC" Network NICKeys = "NETWORK" NetworkMask NICKeys = "NETWORK_MASK" NetworkID NICKeys = "NETWORK_ID" NetworkUID NICKeys = "NETWORK_UID" NetworkUName NICKeys = "NETWORK_UNAME" NetworkAddress NICKeys = "NETWORK_ADDRESS" SecurityGroups NICKeys = "SECURITY_GROUPS" Target NICKeys = "TARGET" VlanID NICKeys = "VLAN_ID" Script NICKeys = "SCRIPT" Model NICKeys = "MODEL" InboundAvgBw NICKeys = "INBOUND_AVG_BW" InboundPeakBw NICKeys = "INBOUND_PEAK_BW" InboundPeakK NICKeys = "INBOUND_PEAK_KB" OutboundAvgBw NICKeys = "OUTBOUND_AVG_BW" OutboundPeakBw NICKeys = "OUTBOUND_PEAK_BW" OutboundPeakKb NICKeys = "OUTBOUND_PEAK_KB" NetworkMode NICKeys = "NETWORK_MODE" SchedRequirements NICKeys = "SCHED_REQUIREMENTS" SchedRank NICKeys = "SCHED_RANK" Name NICKeys = "NAME" Parent NICKeys = "PARENT" External NICKeys = "EXTERNAL" ExternalIP NICKeys = "EXTERNAL_IP" )
Some keys are specific to VM some others to VRouter For VM values: https://docs.opennebula.io/5.8/operation/references/template.html#network-section
const ( SchedActionVec string = "SCHED_ACTION" ActionID SchedActionKeys = "ID" ParentID SchedActionKeys = "PARENT_ID" Action SchedActionKeys = "ACTION" Time SchedActionKeys = "TIME" Repeat SchedActionKeys = "REPEAT" Days SchedActionKeys = "DAYS" EndType SchedActionKeys = "END_TYPE" EndValue SchedActionKeys = "END_VALUE" Done SchedActionKeys = "DONE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatastoreQuota ¶
type DatastoreQuota struct { ID int `xml:"ID"` Images int `xml:"IMAGES"` ImagesUsed int `xml:"IMAGES_USED,omitempty"` Size int `xml:"SIZE"` SizeUsed int `xml:"SIZE_USED,omitempty"` }
DatastoreQuota keeps quota for a datastore
type Disk ¶
Disk is a structure allowing to parse disk templates
type DiskKeys ¶
type DiskKeys string
DiskKeys is here to help the user to keep track of XML tags defined in Disk
type DiskSnapshot ¶
type DiskSnapshot struct { AllowOrphans string `xml:"ALLOW_ORPHANS"` CurrentBase int `xml:"CURRENT_BASE"` DiskID int `xml:"DISK_ID"` NextSnapshot int `xml:"NEXT_SNAPSHOT"` Snapshots []Snapshot `xml:"SNAPSHOT"` }
DiskSnapshot represent a disk snapshot
type EntitiesID ¶
type EntitiesID struct {
ID []int `xml"ID,omitempty"`
}
type ImageQuota ¶
type ImageQuota struct { ID int `xml:"ID"` RVMs int `xml:"RVMS"` RVMsUsed int `xml:"RVMS_USED,omitempty"` }
ImageQuota keeps quota for an image
type Lock ¶
type Lock struct { Locked int `xml:"LOCKED"` Owner int `xml:"OWNER"` Time int `xml:"TIME"` ReqID int `xml:"REQ_ID"` }
Lock actions on a resources
type NIC ¶
NIC is a structure allowing to parse NIC templates. Common to VM and VRouter.
type NICKeys ¶
type NICKeys string
NICKeys is here to help the user to keep track of XML tags defined in NIC
type NetworkQuota ¶
type NetworkQuota struct { ID int `xml:"ID"` Leases int `xml:"LEASES"` LeasesUsed int `xml:"LEASES_USED,omitempty"` }
NetworkQuota keeps quota for a network
type Permissions ¶
type Permissions struct { OwnerU int8 `xml:"OWNER_U" json:"OWNER_U,string"` OwnerM int8 `xml:"OWNER_M" json:"OWNER_M,string"` OwnerA int8 `xml:"OWNER_A" json:"OWNER_A,string"` GroupU int8 `xml:"GROUP_U" json:"GROUP_U,string"` GroupM int8 `xml:"GROUP_M" json:"GROUP_M,string"` GroupA int8 `xml:"GROUP_A" json:"GROUP_A,string"` OtherU int8 `xml:"OTHER_U" json:"OTHER_U,string"` OtherM int8 `xml:"OTHER_M" json:"OTHER_M,string"` OtherA int8 `xml:"OTHER_A" json:"OTHER_A,string"` }
Permissions is associated to OpenNebula resources * uu: USER USE bit. * um: USER MANAGE bit. * ua: USER ADMIN bit. * gu: GROUP USE bit. * gm: GROUP MANAGE bit. * ga: GROUP ADMIN bit. * ou: OTHER USE bit. * om: OTHER MANAGE bit. * oa: OTHER ADMIN bit.
func NewDefaultPermission ¶
func NewDefaultPermission() Permissions
func (Permissions) Octet ¶
func (p Permissions) Octet() int
func (Permissions) String ¶
func (p Permissions) String() string
func (Permissions) ToArgs ¶
func (p Permissions) ToArgs() []interface{}
If a bit is set to -1, it will not change when calling Chmod
type Quotas ¶
type Quotas struct { XMLName xml.Name `xml:"QUOTAS"` ID int `xml:"ID"` QuotasList }
Quotas keeps quota value per User or Group
type QuotasList ¶
type QuotasList struct { Datastore []DatastoreQuota `xml:"DATASTORE_QUOTA>DATASTORE"` Network []NetworkQuota `xml:"NETWORK_QUOTA>NETWORK"` VM *VMQuota `xml:"VM_QUOTA>VM"` Image []ImageQuota `xml:"IMAGE_QUOTA>IMAGE"` }
QuotasList keeps quota per entity type
type SchedAction ¶
SchedAction is a scheduled action on VM
func NewSchedAction ¶
func NewSchedAction() *SchedAction
AddSchedAction returns a Scheduled Action structure
func (*SchedAction) Add ¶
func (sa *SchedAction) Add(key SchedActionKeys, value interface{})
Add adds a key, value pair to Scheduled Action
func (*SchedAction) Get ¶
func (t *SchedAction) Get(key SchedActionKeys) (string, error)
Get return the string value for Scheduled Action key
func (*SchedAction) GetI ¶
func (d *SchedAction) GetI(key SchedActionKeys) (int, error)
GetI returns the integer value for a disk key
func (*SchedAction) ID ¶
func (sa *SchedAction) ID() (int, error)
ID returns the Scheduled Action ID as an integer
type Snapshot ¶
type Snapshot struct { Children string `xml:"CHILDREN"` //minOccur=0 Active string `xml:"ACTIVE"` //minOccur=0 Date int `xml:"DATE"` ID int `xml:"ID"` Name string `xml:"NAME"` //minOccur=0 Parent int `xml:"PARENT"` Size int `xml:"SIZE"` }
Snapshot is a common part for external snapshot structures
type VMQuota ¶
type VMQuota struct { CPU float32 `xml:"CPU"` CPUUsed float32 `xml:"CPU_USED,omitempty"` Memory int `xml:"MEMORY"` MemoryUsed int `xml:"MEMORY_USED,omitempty"` RunningCPU float32 `xml:"RUNNING_CPU"` RunningCPUUsed float32 `xml:"RUNNING_CPU_USED,omitempty"` RunningMemory int `xml:"RUNNING_MEMORY"` RunningMemoryUsed int `xml:"RUNNING_MEMORY_USED,omitempty"` RunningVMs int `xml:"RUNNING_VMS"` RunningVMsUsed int `xml:"RUNNING_VMS_USED,omitempty"` SystemDiskSize int64 `xml:"SYSTEM_DISK_SIZE"` SystemDiskSizeUsed int64 `xml:"SYSTEM_DISK_SIZE_USED,omitempty"` VMs int `xml:"VMS"` VMsUsed int `xml:"VMS_USED,omitempty"` }
VMQuota keeps quota for all VMs in the group