Giter Site home page Giter Site logo

dragse / proxmox-api-go Goto Github PK

View Code? Open in Web Editor NEW
11.0 0.0 2.0 122 KB

A golang client libary for the proxmox ve rest api

License: GNU General Public License v3.0

Go 100.00%
proxmox-ve proxmox-api golang-library golang go api-client-go api-client qemu proxmox proxmox-cluster proxmox-apis golang-package

proxmox-api-go's Introduction

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/[email protected]

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: [email protected]

License

The project is licensed under the GPL-3.0 License.

proxmox-api-go's People

Contributors

lennard-brinkhaus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ggggzl cdntip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.