Skip to main content

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

Project description

master branch: master_build_status master_coverage_status pypi_version pypi_downloads

develop branch: develop_build_status develop_coverage_status

Proxmoxer is a python wrapper around the Proxmox REST API v2. It currently supports the Proxmox services of Proxmox Virtual Environment (PVE), Proxmox Mail Gateway (PMG), and Proxmox Backup Server (PBS).

It was inspired by slumber, but it is dedicated only to Proxmox. It allows not only REST API use 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.

Full Documentation is available at https://proxmoxer.github.io/docs/

Migrating to version 2

Full instructions for the minimal steps needed to update to version 2 can be found in Migration Docs.

Installation

pip install proxmoxer

To use the ‘https’ backend, install requests

pip install requests

To use the ‘ssh_paramiko’ backend, install paramiko

pip install paramiko

To use the ‘openssh’ backend, install openssh_wrapper

pip install openssh_wrapper

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 to PVE through the ‘https’ backend.

Note: ensure you have the required libraries (listed above) for the connection method you are using

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

Using the paths from the PVE API v2, you can create API calls using the access methods above.

>>> for node in proxmox.nodes.get():
...     for vm in proxmox.nodes(node["node"]).qemu.get():
...         print(f"{vm['vmid']}. {vm['name']} => {vm['status']}")
...

141. puppet-2.london.example.com => running
101. munki.london.example.com => running
102. redmine.london.example.com => running
140. dns-1.london.example.com => running
126. ns-3.london.example.com => running
113. rabbitmq.london.example.com => running

See Changelog in CHANGELOG.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxmoxer-2.1.0.tar.gz (28.8 kB view details)

Uploaded Source

Built Distribution

proxmoxer-2.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file proxmoxer-2.1.0.tar.gz.

File metadata

  • Download URL: proxmoxer-2.1.0.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for proxmoxer-2.1.0.tar.gz
Algorithm Hash digest
SHA256 d92993782e74ed8a76ff355dc050f58aa039fa697f9349a68e643552bd0fa62e
MD5 7c9dc721e98c5d737194e3bc4a3329fc
BLAKE2b-256 e399eb6129acd6552178b5fb20d101e43f1c78695140f1c3c2769f5dcb37a56d

See more details on using hashes here.

File details

Details for the file proxmoxer-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: proxmoxer-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for proxmoxer-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59d69abc5742c6c1b1737ce2944599136f66cdbbb1d044cd4b7aad30100ddde6
MD5 ea49a99a50b6c15644e894fefec30912
BLAKE2b-256 9b17b502aadc7556ba79b384da0cc506c8d8ef38e330ce9782321b1b00bcac1e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page