The Proxmox API in golang. This Framework is still work in progress.
- Version Endpoint
- Get Next VM ID
- List all Nodes
- List all VMs of the Node
- Get Node Status of a specific Node
- Get Time Configuration of a specific Node
- Update Time Zone of a specific node
- Create VM
- Create VNC TCP Proxy
- Get VM Status
- Update VM Status
- Get Firewall Log
- Get Firewall Options
- Update Firewall Options
- List IPSets
- Create IPSets
- Delete IPSets
- Add CIDR to IPSet
- Remove CIDR from IPSet
- Copy a specific VM
- Update the config of a VM
- Resize a disk of a VM
- Set CloudInitOptions
- Create Pool
- List All Pools
- Show Pool Details
go get github.com/dragse/[email protected]
Create at first a client object. This objects manage and handle the http connections to the nodes
proxClient := client.NewProxmoxClient()
After that you need to add all Nodes you want to connect. It is recommended to connect to multiple nodes if you have a
cluster and want high availability
The Cluster work with api tokens, you need to generate before.
session := client.ProxmoxSession{
Hostname: "hostname of the proxmox node",
Username: "username@pve!token-name",
Token: "apitoken",
}
err := proxClient.AddSession(&session)
if err != nil {
log.Fatal(err)
}
The last step is to create the Cluster and init the information
proxCluster := proxmox.NewProxmoxCluster(proxClient)
err = proxCluster.InitInformation()
if err != nil {
log.Fatal(err)
}
Now you can use the different methods to get or change Information of the cluster
If you are having issues, please let us know. We have a mailing list located at: [email protected]
The project is licensed under the GPL-3.0 License.