Proxmoxer is a Python wrapper around the Proxmox REST API v2, supporting Proxmox Virtual Environment (PVE), Proxmox Mail Gateway (PMG), and Proxmox Backup Server (PBS). It enables API calls over HTTPS, SSH, and the `pvesh` utility. The library dynamically creates attributes to mirror the Proxmox API structure, making interaction intuitive. The current stable version is 2.3.0, and it receives regular updates.
pip install proxmoxerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to a Proxmox host using the HTTPS backend and retrieve a list of nodes and QEMU virtual machines. Credentials are loaded from environment variables for security. Remember to install `requests` for the HTTPS backend to work.
Avoid direct use of `ProxmoxResourceBase`. Instead, use `ProxmoxResource` or the high-level API access methods.
Update all imports and references to `AuthenticationError` to use `from proxmoxer import AuthenticationError`.
Migrate to using API tokens as the primary authentication method. If an existing token is passed as a password, `proxmoxer` will attempt to renew it. Refer to Proxmoxer documentation for API token usage.
For development or testing environments, set `verify_ssl=False` in the `ProxmoxAPI` constructor. For production, ensure proper certificate handling by either installing the Proxmox CA certificate or providing a valid CA bundle path.
Install the necessary dependencies manually (e.g., `pip install requests`) or use the extras syntax (e.g., `pip install proxmoxer[https]`) for your chosen backend.
Install 'proxmoxer' and its necessary backend dependencies using pip: `pip install proxmoxer requests` (for HTTPS backend) or `pip install proxmoxer paramiko` (for SSH backend).
Double-check the credentials (username, password, realm, or API token) and ensure the user has appropriate permissions on the Proxmox server. If using a self-signed SSL certificate, initialize `ProxmoxAPI` with `verify_ssl=False`.
Examine the specific error message returned by the Proxmox API (e.g., 'unable to find configuration file for VM', 'VM 100 already exists') to identify and correct the underlying Proxmox configuration or state issue.
Add checks to ensure that the results of 'proxmoxer' API calls are not 'None' before attempting to access their attributes. Verify the existence of resources before operating on them.