proxmox-api-go

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

README

proxmox-api-go

The Proxmox API in golang. This Framework is still work in progress.

Features

Cluster
  • Version Endpoint
  • Get Next VM ID
Node
  • 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
VM
  • 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
Pools
  • Create Pool
  • List All Pools
  • Show Pool Details

Installation

go get github.com/DragSE/proxmox-api-go

Usage

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

Support

If you are having issues, please let us know. We have a mailing list located at: proxmox-apit@dragse.de

License

The project is licensed under the GPL-3.0 License.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL