Skip to main content

Proxmox Mail Gateway API

Project description

clientapi_pmg

Python SDK for the Proxmox Mail Gateway API. Generated from the upstream apidoc.js from Proxmox Mail Gateway via openapi-generator-cli with custom Mustache template overrides.

Not an official Proxmox project. Community SDK derived from the upstream apidoc.js. Always verify against the upstream API viewer. https://pmg.proxmox.com/.

Requires Python ≥ 3.9.

Install

pip install clientapi-pmg

Or for development:

pip install -r requirements.txt

Usage

from clientapi_pmg import Configuration, Pve

cfg = Configuration(
    host='https://pmg1.example.com:8006/api2/json',
    api_key={'Authorization': 'PMGAPIToken=user@realm!tokenid=uuid-secret'},
)
pmg = Pmg(configuration=cfg)

# Per-tag properties are lazily instantiated and share the same ApiClient.
# `removeOperationIdPrefix=true` strips the tag prefix from method names,
# so the call is `pmg.qemu.vm_status(...)`, not `pmg.qemu.qemu_vm_status(...)` —
# you're already inside the `qemu` namespace.
status = pmg.qemu.vm_status(node='pmg1', vmid=100)
nodes = pmg.nodes.get_nodes()

Discovering available methods

Each per-tag API class lives at clientapi_pmg.api.<tag>_api.<Tag>Api. List its methods to see what's callable:

print([m for m in dir(pmg.qemu) if not m.startswith('_')])

Generated method-level docstrings explain parameters; the upstream endpoint reference is the upstream API viewer.

The unified Pmg class wraps each per-tag API class (QemuApi, LxcApi, ClusterApi, NodesApi, …) so consumers don't need to instantiate them individually.

Compound configs

PVE encodes many fields as CLI-style shorthand strings (net0=virtio,bridge=vmbr0,firewall=1). Round-trip helpers are emitted for every compound config schema:

from clientapi_pmg.models import PveQemuNetConfig

cfg = PveQemuNetConfig(model='virtio', bridge='vmbr0', firewall=1)
shorthand = cfg.to_shorthand()  # → 'virtio,bridge=vmbr0,firewall=1'

parsed = PveQemuNetConfig.from_shorthand(shorthand)

Indexed families

Numbered properties (net0..net31, mp0..mp255, …) are exposed on every model as a single collapsed nets / mps / … field:

req = QemuCreateVmRequest(
    nets={
        0: 'virtio,bridge=vmbr0',
        3: 'e1000,bridge=vmbr1',
    },
)
# Wire format: { 'net0': 'virtio,bridge=vmbr0', 'net3': 'e1000,bridge=vmbr1' }

License

Apache 2.0 — see LICENSE.

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

clientapi_pmg-2026.5.24.tar.gz (288.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clientapi_pmg-2026.5.24-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file clientapi_pmg-2026.5.24.tar.gz.

File metadata

  • Download URL: clientapi_pmg-2026.5.24.tar.gz
  • Upload date:
  • Size: 288.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for clientapi_pmg-2026.5.24.tar.gz
Algorithm Hash digest
SHA256 560dab139f1ce985dc44054013f430f5428dd9559d3ec5c907822880e9dc9afb
MD5 089e6a048dcc6e69ed2b6cdf3f627790
BLAKE2b-256 eb683e2598caac0e70d5a5dcc3f78c2bfcf912913b0425bf0660473084083eb0

See more details on using hashes here.

File details

Details for the file clientapi_pmg-2026.5.24-py3-none-any.whl.

File metadata

File hashes

Hashes for clientapi_pmg-2026.5.24-py3-none-any.whl
Algorithm Hash digest
SHA256 4a0852e59364dea51b2d8d0ff8a015ec957e29196cd2d0a415da8f08673dc0f0
MD5 842117ec51264cd64bb565569c205322
BLAKE2b-256 af6d59b1a0fa94ccf441879e9f95cd6a22e4026ca752f76a074b5ba7eac46ced

See more details on using hashes here.

Supported by

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