Documentation
¶
Index ¶
- type ActivityEvent
- type CloudInitCommonFields
- type CloudInitConfig
- type CloudInitNetworkConfig
- type CreateNWFilterRequest
- type CreateSnapshotRequest
- type Disk
- type HealthCheck
- type HostResources
- type HostStatus
- type Image
- type NIC
- type NWFilter
- type NWFilterRule
- type Network
- type PXEConfig
- type PerformanceSample
- type PoolConfig
- type Snapshot
- type StoragePool
- type SystemInterface
- type VMCreationConfig
- type VM_Detailed
- type VM_Summary
- type VNCInfo
- type Volume
- type VolumeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivityEvent ¶
type ActivityEvent struct {
ID string `json:"id"`
Timestamp int64 `json:"timestamp"` // Unix timestamp
Action string `json:"action"` // "VM Started", "Snapshot Created"
Target string `json:"target"` // "web-server-01"
Status string `json:"status"` // "Success", "Error"
Message string `json:"message"`
}
ADD a type for Activity Log
type CloudInitCommonFields ¶
type CloudInitCommonFields struct {
Hostname string `json:"hostname"`
Username string `json:"username"`
Password string `json:"password"`
Packages []string `json:"packages,omitempty"`
SSHKeys string `json:"sshKeys"`
NetworkConfig *CloudInitNetworkConfig `json:"networkConfig,omitempty"`
}
CloudInitCommonFields represents common cloud-init settings
type CloudInitConfig ¶
type CloudInitConfig struct {
CommonFields CloudInitCommonFields `json:"commonFields"`
RawUserData string `json:"rawUserData"`
}
CloudInitConfig represents cloud-init configuration
type CloudInitNetworkConfig ¶
type CloudInitNetworkConfig struct {
UseDHCP bool `json:"useDHCP"`
IPAddress string `json:"ipAddress,omitempty"`
Prefix int `json:"prefix,omitempty"`
Gateway string `json:"gateway,omitempty"`
DNSServers []string `json:"dnsServers,omitempty"`
}
CloudInitNetworkConfig represents network configuration for cloud-init
type CreateNWFilterRequest ¶
type CreateNWFilterRequest struct {
Name string `json:"name"`
Rules []NWFilterRule `json:"rules"`
}
CreateNWFilterRequest is the request body for creating a network filter
type CreateSnapshotRequest ¶
type CreateSnapshotRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
CreateSnapshotRequest is the body for the snapshot creation endpoint.
type Disk ¶
type Disk struct {
SourcePath string `json:"source_path"`
TargetDev string `json:"target_dev"`
Device string `json:"device"`
}
Disk / NIC small models for detailed view:
type HealthCheck ¶
type HealthCheck struct {
Type string `json:"type"` // "warning", "info", "error"
Message string `json:"message"`
}
HealthCheck represents a system health status
type HostResources ¶
type HostResources struct {
TotalMemoryKB uint64 `json:"total_memory_kb"`
FreeMemoryKB uint64 `json:"free_memory_kb"`
CPUCores int `json:"cpu_cores"`
StorageTotalB uint64 `json:"storage_total_b"`
StorageUsedB uint64 `json:"storage_used_b"`
ActiveInterfaces int `json:"active_interfaces"`
}
HostResources is an aggregate view of memory/cpu/storage.
type HostStatus ¶
type HostStatus struct {
Hostname string `json:"hostname"`
HypervisorVersion string `json:"hypervisor_version"`
TotalVMs int `json:"total_vms"`
RunningVMs int `json:"running_vms"`
PausedVMs int `json:"paused_vms"`
ShutOffVMs int `json:"shutoff_vms"`
HealthChecks []HealthCheck `json:"health_checks"`
}
HostStatus is the light-weight host summary for the frontend/CLI.
type NWFilter ¶
type NWFilter struct {
Name string `json:"name"`
UUID string `json:"uuid"`
XML string `json:"xml"`
}
NWFilter represents a libvirt network filter
type NWFilterRule ¶
type NWFilterRule struct {
Action string `json:"action"` // "accept" or "drop"
Direction string `json:"direction"` // "in", "out", or "inout"
Priority int `json:"priority"` // rule priority (lower = higher priority)
Protocol string `json:"protocol"` // "tcp", "udp", "icmp", "all"
SrcIP string `json:"srcip,omitempty"`
DstIP string `json:"dstip,omitempty"`
SrcPort string `json:"srcport,omitempty"`
DstPort string `json:"dstport,omitempty"`
}
NWFilterRule represents a single firewall rule
type Network ¶
type Network struct {
Name string `json:"name"`
UUID string `json:"uuid"`
IsActive bool `json:"is_active"`
IsPersistent bool `json:"is_persistent"`
Bridge string `json:"bridge"`
}
ADD a type for Network
type PXEConfig ¶
type PXEConfig struct {
KernelURL string `json:"kernelUrl"` // URL to kernel (vmlinuz)
InitrdURL string `json:"initrdUrl"` // URL to initrd
KernelArgs string `json:"kernelArgs"` // Kernel command line arguments (e.g., ks=http://...)
BootFromPXE bool `json:"bootFromPxe"` // Whether to boot from network
}
PXEConfig represents PXE/network boot configuration
type PerformanceSample ¶
type PoolConfig ¶
type Snapshot ¶
type Snapshot struct {
Name string `json:"name"`
State string `json:"state"`
CreationTS int64 `json:"creation_ts"` // Unix timestamp
Description string `json:"description"`
}
ADD THIS NEW STRUCT FOR SNAPSHOTS
type StoragePool ¶
type StoragePool struct {
Name string `json:"name"`
State string `json:"state"` // <-- ADD THIS FIELD
CapacityB uint64 `json:"capacity_b"`
AllocationB uint64 `json:"allocation_b"`
}
Storage / Volume types:
type SystemInterface ¶
type SystemInterface struct {
Name string `json:"name"`
Type string `json:"type"` // physical, bridge, tap, virtual
State string `json:"state"` // up, down, inactive
IPAddresses []string `json:"ip_addresses"`
MACAddress string `json:"mac_address"`
MTU int `json:"mtu"`
Speed string `json:"speed"`
RxBytes uint64 `json:"rx_bytes"`
TxBytes uint64 `json:"tx_bytes"`
RxPackets uint64 `json:"rx_packets"`
TxPackets uint64 `json:"tx_packets"`
}
SystemInterface represents a physical or virtual network interface
type VMCreationConfig ¶
type VMCreationConfig struct {
Name string
MemoryMB uint64
VCPUs int
ImageName string // from managed image library
ImageType string // "iso" or "template" or "pxe"
StartOnCreate bool
NetworkName string // libvirt network name (ex: default)
CloudInit *CloudInitConfig `json:"cloudInit,omitempty"`
DiskPool string
DiskSizeGB uint64
EnableCloudInit bool
PXEConfig *PXEConfig `json:"pxeConfig,omitempty"` // PXE boot configuration
}
VMCreationConfig - updated for cloud-init and image library
type VM_Detailed ¶
type VM_Detailed struct {
VM_Summary
MaxMemoryKB uint64 `json:"max_memory_kb"` // <-- ADD THIS
XML string `json:"xml"`
Disks []Disk `json:"disks"`
Nics []NIC `json:"nics"`
OS string `json:"os"` // simple OS info parsed from XML <os> block
}
VM_Detailed is the rich VM view.
type VM_Summary ¶
type VM_Summary struct {
Name string `json:"name"`
UUID string `json:"uuid"`
State string `json:"state"`
MemoryKB uint64 `json:"memory_kb"`
VCPUs int `json:"vcpus"`
CPUPercent float64 `json:"cpu_percent"` // computed over sample window
UptimeSec uint64 `json:"uptime_sec"`
OSInfo string `json:"os_info"`
IPAddresses []string `json:"ip_addresses"`
}
VM_Summary is the light info for lists.
type VNCInfo ¶
type VNCInfo struct {
VMUUID string `json:"vm_uuid"`
Host string `json:"host"`
Port string `json:"port"`
}
VNCInfo holds VNC connection details for a VM