I have a go client initialized to connect to a vCenter as follows. I am trying to get the version of the vCenter using the client. I did not find a very good source for this.
Which arguments to use inside retrieve() API to get the version and other information related to vCenter cluster?
import (
"context"
"fmt"
"net/url"
"github.com/vmware/govmomi"
)
func main() {
vURL := url.URL{
Scheme: "https",
Host: "10.30.8.34",
Path: "sdk",
}
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
client, err := govmomi.NewClient(ctx, vURL, true)
if err != nil {
fmt.Printf("Logging in error: %s\n", err.Error())
return
}
fmt.Println("Log in successful")
client.Logout(ctx)
}