Documentation
¶
Index ¶
- Variables
- func Absum(param ...string) string
- func AddNWFilterKvm(c *gin.Context)
- func AddNWFilterRule(param map[string]string) error
- func BootOrder(boot, host_name string) error
- func BootOrderKvm(c *gin.Context)
- func CopyFile(dstName, srcName string) (written int64, err error)
- func CountFlow(host_name string) (tx int64, rx int64)
- func CountFlowKvm(c *gin.Context)
- func CreateBackup(data map[string]string) error
- func CreateBackupKvm(c *gin.Context)
- func CreateDomain(data map[string]string) (map[string]string, error)
- func CreateKvm(c *gin.Context)
- func CreateSnapshot(data map[string]string) error
- func CreateSnapshotkvm(c *gin.Context)
- func CreateStoragePool(name, path string) error
- func CreateVolume(path, capacity, name string) (string, error)
- func DeleteVolume(poolName, volumeName string) error
- func Exec_shell(shellstring string) (string, error)
- func GetCreateDomainXml() string
- func GetCreatePoolXml() string
- func GetCreateVolumeXml() string
- func GetDomainCpuUse(host_name string) string
- func GetDomainMemoryStats(host_name string) string
- func GetDomainNetworkIO(host_name, name string) (string, string, string, string)
- func GetDomainStatus(host_name string) bool
- func GetIsoList(iso_path string) (map[string]string, error)
- func GetIsoListKvm(c *gin.Context)
- func GetNetworkFlowKvm(c *gin.Context)
- func GetSnapshotXml() string
- func GetStatusKvm(c *gin.Context)
- func GetUUIDBuild() string
- func GetVolumeInfo(host_name, dev string) (string, string)
- func InitNWFilter(name string) error
- func ManageStoragePool(name, command string) error
- func MonitorKvm(c *gin.Context)
- func NetworkCloseOrOpen(host_name, state string) error
- func NetworkCloseOrOpenKvm(c *gin.Context)
- func QemuAgentCommand(host_name, command string) error
- func ReinstallKvm(c *gin.Context)
- func RemoveBackup(data map[string]string) error
- func RemoveBackupKvm(c *gin.Context)
- func RemoveFile(path string) error
- func RemoveKvm(c *gin.Context)
- func RemoveNWFilterKvm(c *gin.Context)
- func RemoveNWFilterRule(host_name, name string) error
- func RemoveSnapshot(data map[string]string) error
- func RemoveSnapshotKvm(c *gin.Context)
- func RestoreBackup(data map[string]string) error
- func RestoreBackupKvm(c *gin.Context)
- func RestoreSnapshot(data map[string]string) error
- func RestoreSnapshotKvm(c *gin.Context)
- func SetDomainStatus(status int, host_name string) error
- func SetPoolAutoStart(name string, auto bool) error
- func SetStatusKvm(c *gin.Context)
- func Setup()
- func UnNWFilter(name string)
- func UpClock(host_name, clock string) error
- func UpdateIPKvm(c *gin.Context)
- func UpdateIPV4(data map[string]string) error
- func UpdateIso(data map[string]string) error
- func UpdateIsoKvm(c *gin.Context)
- func UpdateKvm(c *gin.Context)
- func UpdateSystemPassword(c *gin.Context)
- func VolResize(path string, capacity uint64) error
- type AddNWFilterStruct
- type ArchStruct
- type BackupStruct
- type BootOrderStruct
- type CreateSnapshotStruct
- type CreateStruct
- type DomainMemoryStats
- type GetIsoListStruct
- type HostNameStruct
- type MonitorStruct
- type ReinstallStruct
- type RemoveNWFilterStruct
- type RemoveSnapshotStruct
- type RemoveStruct
- type RestoreSnapshotStruct
- type SetStatusStruct
- type UpdateIPStruct
- type UpdateIsoStruct
- type UpdateSystemPasswordStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var Conn *libvirt.Connect
View Source
var ConnError error
Functions ¶
func AddNWFilterRule ¶
添加一个防火墙策略 host_name,name,protocol,action,direction,priority,port,start_ip,end_ip string
func CountFlowKvm ¶
func Exec_shell ¶
func GetCreateDomainXml ¶
func GetCreateDomainXml() string
func GetCreatePoolXml ¶
func GetCreatePoolXml() string
func GetCreateVolumeXml ¶
func GetCreateVolumeXml() string
func GetDomainMemoryStats ¶
内存使用情况 name = network name or mac
func GetDomainNetworkIO ¶
网络使用情况 name = network name or mac
func GetIsoListKvm ¶
func GetNetworkFlowKvm ¶
func GetSnapshotXml ¶
func GetSnapshotXml() string
func GetUUIDBuild ¶
func GetUUIDBuild() string
func NetworkCloseOrOpen ¶
func NetworkCloseOrOpenKvm ¶
func RemoveFile ¶
func SetPoolAutoStart ¶
设置存储池是否开机启动 true随机启动 false不随机启动
func SetStatusKvm ¶
Types ¶
type AddNWFilterStruct ¶
type AddNWFilterStruct struct { HostName string `json:"host_name" binding:"required"` Name string `json:"name" binding:"required"` Protocol string `json:"protocol" binding:"required"` Action string `json:"action" binding:"required"` Direction string `json:"direction" binding:"required"` Priority string `json:"priority" binding:"required"` Port string `json:"port" binding:"required"` StartIp string `json:"start_ip" binding:"required"` EndIp string `json:"end_ip"` }
type ArchStruct ¶
type ArchStruct struct {
Arch string `xml:"host>cpu>arch"`
}
type BackupStruct ¶
type BootOrderStruct ¶
type CreateSnapshotStruct ¶
type CreateStruct ¶
type CreateStruct struct { HostName string `json:"host_name" binding:"required"` HostUuid string `json:"host_uuid" ` MaxRam string `json:"max_ram" binding:"required"` MinRam string `json:"min_ram" binding:"required"` Cpu string `json:"cpu" binding:"required"` CpuModel string `json:"cpu_model" binding:"required"` OsType string `json:"os_type" binding:"required"` Bandwidth string `json:"bandwidth" binding:"required"` Otherip string `json:"otherip" ` IP string `json:"ip" binding:"required"` Gateway string `json:"gateway" binding:"required"` Netmask string `json:"netmask" binding:"required"` DNS1 string `json:"dns1" binding:"required"` DNS2 string `json:"dns2" binding:"required"` MAC string `json:"mac" binding:"required"` ReCreate string `json:"re_create" ` IP1 string `json:"ip1" binding:"required"` Gateway1 string `json:"gateway1" ` Netmask1 string `json:"netmask1" binding:"required"` MAC1 string `json:"mac1" binding:"required"` TemplatePath string `json:"template_path" binding:"required"` DataPath string `json:"data_path" binding:"required"` OsName string `json:"os_name" binding:"required"` HostData string `json:"host_data" binding:"required"` DataRead string `json:"data_read" binding:"required"` DataWrite string `json:"data_write" binding:"required"` OsRead string `json:"os_read" binding:"required"` OsWrite string `json:"os_write" binding:"required"` DataIops string `json:"data_iops" binding:"required"` OsIops string `json:"os_iops" binding:"required"` VncPort string `json:"vnc_port" binding:"required"` VncPassword string `json:"vnc_password" binding:"required"` Password string `json:"password" binding:"required"` }
type DomainMemoryStats ¶
type GetIsoListStruct ¶
type GetIsoListStruct struct {
IsoPath string `json:"iso_path" binding:"required"`
}
type HostNameStruct ¶
type HostNameStruct struct {
HostName string `json:"host_name" binding:"required"`
}
type MonitorStruct ¶
type ReinstallStruct ¶
type ReinstallStruct struct { HostName string `json:"host_name" binding:"required"` OsType string `json:"os_type" binding:"required"` IP string `json:"ip" binding:"required"` Gateway string `json:"gateway" binding:"required"` Netmask string `json:"netmask" binding:"required"` DNS1 string `json:"dns1" binding:"required"` DNS2 string `json:"dns2" binding:"required"` MAC string `json:"mac" binding:"required"` IP1 string `json:"ip1" binding:"required"` Gateway1 string `json:"gateway1"` Netmask1 string `json:"netmask1" binding:"required"` MAC1 string `json:"mac1" binding:"required"` Password string `json:"password" binding:"required"` TemplatePath string `json:"template_path" binding:"required"` DataPath string `json:"data_path" binding:"required"` OsName string `json:"os_name" binding:"required"` }
type RemoveNWFilterStruct ¶
type RemoveSnapshotStruct ¶
type RemoveStruct ¶
type RestoreSnapshotStruct ¶
type SetStatusStruct ¶
type UpdateIPStruct ¶
type UpdateIsoStruct ¶
Click to show internal directories.
Click to hide internal directories.