clustvirt/main.go
Matthew Stobbs 4ecf05bf82 Adding basic wrappers
- Wrapper for Host connection called Host
  - Allows for easier usage of the API
- Wrapper for Domains called GuestVM, which pulls VM information and allows
  other functionality in a better way
2024-03-10 20:32:11 -06:00

23 lines
519 B
Go

package main
import (
"log"
)
func main() {
log.Println("Starting clustvirt, the libvirt cluster manager")
// Try connecting to libvirt
doms, err := GetDomsInCluster("earth.staur.ca", "mars.staur.ca", "venus.staur.ca")
if err != nil {
log.Fatal(err)
}
log.Printf("Domains in cluster: %d", len(doms))
// Example of xmlns uri found in libvirt xml definition:
// xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"
for _, d := range doms {
log.Println(d.GetMetadata(0, "", 0))
d.Free()
}
}