Skip to content

tecbiz-ch/nutanix-go-sdk

Repository files navigation

nutanix-go-sdk: A Go library for the Nutanix Prism API

GitHub Actions status GoDoc

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.

Example

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)

}

License

MIT license