Package nutanix is a library for the Nutanix Prism API
The library’s documentation is available at GoDoc, the public API documentation is available at www.nutanix.dev.
package main
import (
"context"
"fmt"
"log"
nutanix "github.com/tecbiz-ch/nutanix-go-sdk"
)
func main() {
configCreds := nutanix.Credentials{
Username: "admin",
Password: "password",
}
opts := []nutanix.ClientOption{
nutanix.WithCredentials(&configCreds),
nutanix.WithEndpoint("https://PC"),
nutanix.WithInsecure(), // Allow insecure
}
client := nutanix.NewClient(opts...)
ctx := context.Background()
mycluster, err = client.Cluster.Get(ctx, "mycluster")
list, err = client.VM.All(ctx)
}
MIT license