pve: Go client library for Proxmox VE APIs
![Go Reference](https://pkg.go.dev/badge/github.com/FedericoAntoniazzi/pve-go.svg)
pve-go is intended to be a client library for Proxmox VE v7.x.
The project is still in early phase of development and it's not considered ready for production.
Installation
go get github.com/federicoantoniazzi/pve-go@latest
Example
package main
import (
"fmt"
"log"
"time"
"github.com/FedericoAntoniazzi/pve-go/pve"
)
func main() {
// Create a new client
pveClient := pve.NewClient(
"https://pve.example.com/api2/json",
pve.WithApiToken("token-id", "super-secret-key"),
pve.AllowInsecureConnection(),
)
// List all nodes
nodes, err := pveClient.Node.List()
if err != nil {
log.Fatal("Error while listing nodes: ", err)
}
// Print all nodes info
for _, node := range nodes {
uptime := time.Duration(node.Uptime) * time.Second
fmt.Println(node.Node, node.IP, uptime)
}
}
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
References
Acknowledgements