client

package module
v0.0.0-...-1f4ade7 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: BSD-2-Clause Imports: 8 Imported by: 0

README

Build Status

go-xenserver-client

This is the beginnings of a golang client library for XenAPI.

Disclaimer!

Please note that this library is currently experimental and only enables a limited subset of XenAPI's interface.

As with any early beginnings of a project, the interfaces are also subject to change, so please beware!

And of course, contributions are most welcome!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResult

type APIResult struct {
	Status           string
	Value            interface{}
	ErrorDescription string
}

type Host

type Host XenAPIObject

func (*Host) CallPlugin

func (self *Host) CallPlugin(plugin, method string, params map[string]string) (response string, err error)

func (*Host) GetAddress

func (self *Host) GetAddress() (address string, err error)

func (*Host) GetSoftwareVersion

func (self *Host) GetSoftwareVersion() (versions map[string]interface{}, err error)

type Network

type Network XenAPIObject

func (*Network) Destroy

func (self *Network) Destroy() (err error)

func (*Network) GetAssignedIPs

func (self *Network) GetAssignedIPs() (ipMap map[string]string, err error)

func (*Network) GetOtherConfig

func (self *Network) GetOtherConfig() (otherConfig map[string]string, err error)

func (*Network) IsHostInternalManagementNetwork

func (self *Network) IsHostInternalManagementNetwork() (isHostInternalManagementNetwork bool, err error)

type PIF

type PIF XenAPIObject

func (*PIF) GetRecord

func (self *PIF) GetRecord() (record map[string]interface{}, err error)

type Pool

type Pool XenAPIObject

func (*Pool) GetMaster

func (self *Pool) GetMaster() (host *Host, err error)

func (*Pool) GetRecord

func (self *Pool) GetRecord() (record map[string]interface{}, err error)

type SR

type SR XenAPIObject

func (*SR) CreateVdi

func (self *SR) CreateVdi(name_label string, size int64) (vdi *VDI, err error)

func (*SR) GetUuid

func (self *SR) GetUuid() (uuid string, err error)

type Task

type Task XenAPIObject

func (*Task) Destroy

func (self *Task) Destroy() (err error)

func (*Task) GetErrorInfo

func (self *Task) GetErrorInfo() (errorInfo []string, err error)

func (*Task) GetProgress

func (self *Task) GetProgress() (progress float64, err error)

func (*Task) GetResult

func (self *Task) GetResult() (object *XenAPIObject, err error)

func (*Task) GetStatus

func (self *Task) GetStatus() (status TaskStatusType, err error)

type TaskStatusType

type TaskStatusType int
const (
	Pending TaskStatusType
	Success
	Failure
	Cancelling
	Cancelled
)

type TransferRecord

type TransferRecord struct {
	UrlFull string `xml:"url_full,attr"`
}

type VBD

type VBD XenAPIObject

func (*VBD) Destroy

func (self *VBD) Destroy() (err error)

func (*VBD) Eject

func (self *VBD) Eject() (err error)

func (*VBD) GetRecord

func (self *VBD) GetRecord() (record map[string]interface{}, err error)

func (*VBD) GetVDI

func (self *VBD) GetVDI() (vdi *VDI, err error)

func (*VBD) Unplug

func (self *VBD) Unplug() (err error)

type VDI

type VDI XenAPIObject

func (*VDI) Destroy

func (self *VDI) Destroy() (err error)

func (*VDI) Expose

func (self *VDI) Expose(format string) (url string, err error)

func (*VDI) Forget

func (self *VDI) Forget() (err error)

func (*VDI) GetUuid

func (self *VDI) GetUuid() (vdi_uuid string, err error)

func (*VDI) GetVBDs

func (self *VDI) GetVBDs() (vbds []VBD, err error)

func (*VDI) GetVirtualSize

func (self *VDI) GetVirtualSize() (virtual_size string, err error)

func (*VDI) SetNameLabel

func (self *VDI) SetNameLabel(name_label string) (err error)

func (*VDI) SetReadOnly

func (self *VDI) SetReadOnly(value bool) (err error)

func (*VDI) SetSharable

func (self *VDI) SetSharable(value bool) (err error)

func (*VDI) Unexpose

func (self *VDI) Unexpose() (err error)

type VDIType

type VDIType int
const (
	Disk VDIType
	CD
	Floppy
)

type VIF

type VIF XenAPIObject

func (*VIF) Destroy

func (self *VIF) Destroy() (err error)

func (*VIF) GetNetwork

func (self *VIF) GetNetwork() (network *Network, err error)

type VM

type VM XenAPIObject

func (*VM) CleanReboot

func (self *VM) CleanReboot() (err error)

func (*VM) CleanShutdown

func (self *VM) CleanShutdown() (err error)

func (*VM) Clone

func (self *VM) Clone(name_label string) (new_instance *VM, err error)

func (*VM) ConnectNetwork

func (self *VM) ConnectNetwork(network *Network, device string) (vif *VIF, err error)

func (*VM) ConnectVdi

func (self *VM) ConnectVdi(vdi *VDI, vdiType VDIType, userdevice string) (err error)

func (*VM) Copy

func (self *VM) Copy(new_name string, targetSr *SR) (new_instance *VM, err error)

func (*VM) Destroy

func (self *VM) Destroy() (err error)

func (*VM) DisconnectVdi

func (self *VM) DisconnectVdi(vdi *VDI) error

func (*VM) GetAllowedVBDDevices

func (self *VM) GetAllowedVBDDevices() (devices []string, err error)

func (*VM) GetAllowedVIFDevices

func (self *VM) GetAllowedVIFDevices() (devices []string, err error)

func (*VM) GetDisks

func (self *VM) GetDisks() (vdis []*VDI, err error)

func (*VM) GetDomainId

func (self *VM) GetDomainId() (domid string, err error)

func (*VM) GetGuestMetrics

func (self *VM) GetGuestMetrics() (metrics map[string]interface{}, err error)

func (*VM) GetGuestMetricsRef

func (self *VM) GetGuestMetricsRef() (ref string, err error)

func (*VM) GetHVMBootPolicy

func (self *VM) GetHVMBootPolicy() (bootOrder string, err error)

func (*VM) GetNameLabel

func (self *VM) GetNameLabel() (name string, err error)

func (*VM) GetOtherConfig

func (self *VM) GetOtherConfig() (other_config map[string]string, err error)

func (*VM) GetPowerState

func (self *VM) GetPowerState() (state string, err error)

func (*VM) GetResidentOn

func (self *VM) GetResidentOn() (host *Host, err error)

func (*VM) GetSnapshots

func (self *VM) GetSnapshots() (vms []*VM, err error)

func (*VM) GetUuid

func (self *VM) GetUuid() (uuid string, err error)

func (*VM) GetVBDs

func (self *VM) GetVBDs() (vbds []VBD, err error)

func (*VM) GetVIFs

func (self *VM) GetVIFs() (vifs []VIF, err error)

func (*VM) GetVMGuestMetrics

func (self *VM) GetVMGuestMetrics() (vm_guest_metrics *VM_Guest_Metrics, err error)

func (*VM) HardReboot

func (self *VM) HardReboot() (err error)

func (*VM) HardShutdown

func (self *VM) HardShutdown() (err error)

func (*VM) Provision

func (self *VM) Provision() (err error)

func (*VM) Resume

func (self *VM) Resume(paused, force bool) (err error)

func (*VM) Revert

func (self *VM) Revert(snapshot *VM) (err error)

func (*VM) SetDescription

func (self *VM) SetDescription(description string) (err error)

func (*VM) SetHVMBoot

func (self *VM) SetHVMBoot(policy, bootOrder string) (err error)

func (*VM) SetHaAlwaysRun

func (self *VM) SetHaAlwaysRun(ha_always_run bool) (err error)

func (*VM) SetIsATemplate

func (self *VM) SetIsATemplate(is_a_template bool) (err error)

func (*VM) SetNameLabel

func (self *VM) SetNameLabel(name_label string) (err error)

func (*VM) SetOtherConfig

func (self *VM) SetOtherConfig(other_config map[string]string) (err error)

func (*VM) SetPVBootloader

func (self *VM) SetPVBootloader(pv_bootloader, pv_args string) (err error)

func (*VM) SetPlatform

func (self *VM) SetPlatform(params map[string]string) (err error)

func (*VM) SetStaticMemoryRange

func (self *VM) SetStaticMemoryRange(min, max uint64) (err error)

func (*VM) SetSuspendSR

func (self *VM) SetSuspendSR(vdi *VDI) (err error)

func (*VM) SetVCPUsAtStartup

func (self *VM) SetVCPUsAtStartup(vcpus uint) (err error)

func (*VM) SetVCPUsMax

func (self *VM) SetVCPUsMax(vcpus uint) (err error)

func (*VM) SetVCpuAtStartup

func (self *VM) SetVCpuAtStartup(vcpus uint) (err error)

func (*VM) SetVCpuMax

func (self *VM) SetVCpuMax(vcpus uint) (err error)

func (*VM) Snapshot

func (self *VM) Snapshot(label string) (snapshot *VM, err error)

func (*VM) Start

func (self *VM) Start(paused, force bool) (err error)

func (*VM) StartOn

func (self *VM) StartOn(host *Host, paused, force bool) (err error)

func (*VM) Unpause

func (self *VM) Unpause() (err error)

type VM_Guest_Metrics

type VM_Guest_Metrics XenAPIObject

func (*VM_Guest_Metrics) GetNetworks

func (self *VM_Guest_Metrics) GetNetworks() (ipMap map[string]string, err error)

type XenAPIClient

type XenAPIClient struct {
	Session  interface{}
	Host     string
	Url      string
	Username string
	Password string
	RPC      *xmlrpc.Client
}

func NewXenAPIClient

func NewXenAPIClient(host, username, password string) (client XenAPIClient)

func (*XenAPIClient) APICall

func (client *XenAPIClient) APICall(result *APIResult, method string, params ...interface{}) (err error)

func (*XenAPIClient) CreateNetwork

func (client *XenAPIClient) CreateNetwork(name_label string, name_description string, bridge string) (network *Network, err error)

func (*XenAPIClient) CreateTask

func (client *XenAPIClient) CreateTask() (task *Task, err error)

func (*XenAPIClient) GetDefaultSR

func (client *XenAPIClient) GetDefaultSR() (sr *SR, err error)

func (*XenAPIClient) GetHostByNameLabel

func (client *XenAPIClient) GetHostByNameLabel(name_label string) (hosts []*Host, err error)

func (*XenAPIClient) GetHostByUuid

func (client *XenAPIClient) GetHostByUuid(host_uuid string) (host *Host, err error)

func (*XenAPIClient) GetHosts

func (client *XenAPIClient) GetHosts() (hosts []*Host, err error)

func (*XenAPIClient) GetNetworkByNameLabel

func (client *XenAPIClient) GetNetworkByNameLabel(name_label string) (networks []*Network, err error)

func (*XenAPIClient) GetNetworkByUuid

func (client *XenAPIClient) GetNetworkByUuid(network_uuid string) (network *Network, err error)

func (*XenAPIClient) GetNetworks

func (client *XenAPIClient) GetNetworks() (networks []*Network, err error)

func (*XenAPIClient) GetPIFs

func (client *XenAPIClient) GetPIFs() (pifs []*PIF, err error)

func (*XenAPIClient) GetPools

func (client *XenAPIClient) GetPools() (pools []*Pool, err error)

func (*XenAPIClient) GetSRByNameLabel

func (client *XenAPIClient) GetSRByNameLabel(name_label string) (srs []*SR, err error)

func (*XenAPIClient) GetSRByUuid

func (client *XenAPIClient) GetSRByUuid(sr_uuid string) (sr *SR, err error)

func (*XenAPIClient) GetVMAll

func (client *XenAPIClient) GetVMAll() (vms []*VM, err error)

func (*XenAPIClient) GetVMByNameLabel

func (client *XenAPIClient) GetVMByNameLabel(name_label string) (vms []*VM, err error)

func (*XenAPIClient) GetVMByUuid

func (client *XenAPIClient) GetVMByUuid(vm_uuid string) (vm *VM, err error)

func (*XenAPIClient) GetVdiByNameLabel

func (client *XenAPIClient) GetVdiByNameLabel(name_label string) (vdis []*VDI, err error)

func (*XenAPIClient) GetVdiByUuid

func (client *XenAPIClient) GetVdiByUuid(vdi_uuid string) (vdi *VDI, err error)

func (*XenAPIClient) Login

func (client *XenAPIClient) Login() (err error)

func (*XenAPIClient) RPCCall

func (c *XenAPIClient) RPCCall(result interface{}, method string, params []interface{}) (err error)

type XenAPIObject

type XenAPIObject struct {
	Ref    string
	Client *XenAPIClient
}

Jump to

Keyboard shortcuts

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