mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
feat(proxmox): enhance VM resource tracking with auto-discovery and cached IPs
- Add VMResource wrapper type with cached IP addresses for efficient lookups - Implement concurrent IP fetching during resource updates (limited concurrency) - Add ReverseLookupResource for discovering VMs by IP, hostname, or alias - Prioritize interfaces API over config for IP retrieval (offline container fallback) - Enable routes to auto-discover Proxmox resources when no explicit config provided - Fix configuration type from value to pointer slice for correct proxmox client retrievel - Ensure Proxmox providers are initialized before route validation
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
type NodeConfig struct {
|
||||
Node string `json:"node" validate:"required"`
|
||||
VMID int `json:"vmid" validate:"required"`
|
||||
VMName string `json:"vmname,omitempty"`
|
||||
Service string `json:"service,omitempty"`
|
||||
} // @name ProxmoxNodeConfig
|
||||
|
||||
@@ -54,6 +55,10 @@ func (n *Node) Name() string {
|
||||
return n.name
|
||||
}
|
||||
|
||||
func (n *Node) Client() *Client {
|
||||
return n.client
|
||||
}
|
||||
|
||||
func (n *Node) String() string {
|
||||
return fmt.Sprintf("%s (%s)", n.name, n.id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user