skip to navigation
skip to content

proxmoxer 1.0.2

Python Wrapper for the Proxmox 2.x API (HTTP and SSH)

master branch:

develop branch:

What does it do and what’s different?

Proxmoxer is a wrapper around the Proxmox REST API v2.

It was inspired by slumber, but it dedicated only to Proxmox. It allows to use not only REST API over HTTPS, but the same api over ssh and pvesh utility.

Like Proxmoxia it dynamically creates attributes which responds to the attributes you’ve attempted to reach.


pip install proxmoxer

For ‘https’ backend install requests

pip install requests

For ‘ssh_paramiko’ backend install paramiko

pip install paramiko

Short usage information

The first thing to do is import the proxmoxer library and create ProxmoxAPI instance.

from proxmoxer import ProxmoxAPI
proxmox = ProxmoxAPI('proxmox_host', user='admin@pam',
                     password='secret_word', verify_ssl=False)

This will connect by default through the ‘https’ backend.

It is possible to use already prepared public/private key authentication. It is possible to use ssh-agent also.

from proxmoxer import ProxmoxAPI
proxmox = ProxmoxAPI('proxmox_host', user='proxmox_admin', backend='ssh_paramiko')

Please note, https-backend needs ‘requests’ library, ssh_paramiko-backend needs ‘paramiko’ library, openssh-backend needs ‘openssh_wrapper’ library installed.

Queries are exposed via the access methods get, post, put and delete. For convenience added two synonyms: create for post, and set for put.

for node in proxmox.nodes.get():
    for vm in proxmox.nodes(node['node']).openvz.get():
        print "{0}. {1} => {2}" .format(vm['vmid'], vm['name'], vm['status'])

>>> 141. => running
    101. => running
    102. => running
    140. => running
    126. => running
    113. => running

same code can be rewritten in the next way:

for node in proxmox.get('nodes'):
    for vm in proxmox.get('nodes/%s/openvz' % node['node']):
        print "%s. %s => %s" %  (vm['vmid'], vm['name'], vm['status'])

for example next lines do the same job:

proxmox.get('nodes/%s/openvz' % node['node'])
proxmox.get('nodes', node['node'], 'openvz')

Some more examples:

for vm in proxmox.cluster.resources.get(type='vm'):
    print("{0}. {1} => {2}" .format(vm['vmid'], vm['name'], vm['status']))
node = proxmox.nodes('proxmox_node')

or the with same results

node = proxmox.nodes.proxmox_node()

Example of creation of lxc container:

node = proxmox.nodes('proxmox_node')

Example of template upload:

local_storage = proxmox.nodes('proxmox_node').storage('local')

Example of rrd download:

response = proxmox.nodes('proxmox').rrd.get(ds='cpu', timeframe='hour')
with open('cpu.png', 'wb') as f:

Example of usage of logging:

# now logging debug info will be written to stdout
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s:%(name)s: %(message)s')


  • write tests
  • support other actual python versions
  • add optional validation of requests
  • add some shortcuts for convenience


1.0.2 (2017-12-02)

  • Tarball repackaged with tests

1.0.1 (2017-12-02)

  • LICENSE file now included in tarball
  • Added verify_ssl parameter to ProxmoxHTTPAuth (Walter Doekes)

1.0.0 (2017-11-12)

0.2.5 (2017-02-12)

0.2.4 (2016-05-02)

0.2.3 (2016-01-20)

0.2.2 (2016-01-19)

0.2.1 (2015-05-02)

0.2.0 (2015-03-21)

  • Https will now raise AuthenticationError when appropriate. (scap1784)
  • Preliminary python 3 compatibility. (wdoekes)
  • Additional example. (wdoekes)

0.1.7 (2014-11-16)

  • Added ignore of “InsecureRequestWarning: Unverified HTTPS request is being made…” warning while using https (requests) backend.

0.1.4 (2013-06-01)

  • Added logging
  • Added openssh backend
  • Tests are reorganized

0.1.3 (2013-05-30)

  • Added next tests
  • Bugfixes

0.1.2 (2013-05-27)

  • Added first tests
  • Added support for travis and coveralls
  • Bugfixes

0.1.1 (2013-05-13)

  • Initial try.
File Type Py Version Uploaded on Size
proxmoxer-1.0.2.tar.gz (md5) Source 2017-12-02 14KB