API Reference

client – ProxmoxAPI

Core HTTP client for the Proxmox VE REST API.

class proxmox_api.client.ProxmoxAPI(host: str, *, user: str | None = None, password: str | None = None, token_name: str | None = None, token_value: str | None = None, port: int = 8006, verify_ssl: bool = False, timeout: int = 30)[source]

Bases: object

Low-level client that handles authentication and HTTP requests.

Supports both API token and ticket (user/password) authentication.

Usage with API token:

api = ProxmoxAPI(
    host="192.168.1.100",
    token_name="mytoken",
    token_value="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    user="root@pam",
)
nodes = api.nodes.list()

Usage with password:

api = ProxmoxAPI(
    host="192.168.1.100",
    user="root@pam",
    password="secret",
)
nodes = api.nodes.list()
request(method: str, path: str, params: dict[str, Any] | None = None, data: dict[str, Any] | None = None) Any[source]

Send a request and return the ‘data’ field from the JSON response.

get(path: str, **kwargs: Any) Any[source]
post(path: str, **kwargs: Any) Any[source]
put(path: str, **kwargs: Any) Any[source]
delete(path: str, **kwargs: Any) Any[source]
property cluster: _ClusterAPI
property nodes: _NodesAPI
property storage: _StorageAPI
property access: _AccessAPI
property pools: _PoolsAPI
version() Any[source]

GET /version

_base – Resource base class

Base class for all resource API groups.

access – Access / authentication

Access control API resources.

cluster – Cluster resources

Cluster-level API resources.

nodes – Node resources

Node-level API resources.

qemu – QEMU VM resources

QEMU VM API resources.

lxc – LXC container resources

LXC container API resources.

node_resources – Disks & node firewall

Node-level resource APIs: disks and firewall.

storage – Storage resources

Storage API resources.

pools – Pool resources

Pools API resources.

parse_apidoc – API doc parser

Parser tool for Proxmox VE API documentation.

Can read from a local apidoc.json file or download the schema directly from the Proxmox documentation site (apidoc.js).

class proxmox_api.parse_apidoc.Parameter(name: 'str', type: 'str', description: 'str', optional: 'bool' = True, default: 'Any' = None, enum: 'list[str] | None' = None, minimum: 'int | float | None' = None, maximum: 'int | float | None' = None, pattern: 'str | None' = None, format: 'str | None' = None, is_path_param: 'bool' = False)[source]

Bases: object

name: str
type: str
description: str
optional: bool = True
default: Any = None
enum: list[str] | None = None
minimum: int | float | None = None
maximum: int | float | None = None
pattern: str | None = None
format: str | None = None
is_path_param: bool = False
property python_name: str

Convert parameter name to valid Python identifier.

property python_type: str

Map JSON-schema type to Python type hint.

class proxmox_api.parse_apidoc.Endpoint(path: 'str', method: 'str', name: 'str', description: 'str', parameters: 'list[Parameter]' = <factory>, returns_type: 'str' = 'Any', protected: 'bool' = False, proxyto: 'str | None' = None)[source]

Bases: object

path: str
method: str
name: str
description: str
parameters: list[Parameter]
returns_type: str = 'Any'
protected: bool = False
proxyto: str | None = None
property path_params: list[Parameter]
property query_or_body_params: list[Parameter]
property required_params: list[Parameter]
property optional_params: list[Parameter]
proxmox_api.parse_apidoc.download_apidoc(url: str = 'https://pve.proxmox.com/pve-docs/api-viewer/apidoc.js', save_to: str | Path | None = None) list[dict][source]

Download apidoc.js from the Proxmox docs and extract the schema.

Parameters:
  • url – URL to the apidoc.js file.

  • save_to – If provided, save the extracted JSON to this path.

Returns:

The parsed API schema as a list of dicts.

proxmox_api.parse_apidoc.parse_apidoc(source: str | Path) list[Endpoint][source]

Parse an API doc source and return a list of all API endpoints.

Parameters:

source – Path to apidoc.json, apidoc.js, or a URL to apidoc.js.

proxmox_api.parse_apidoc.group_by_section(endpoints: list[Endpoint]) dict[str, list[Endpoint]][source]

Group endpoints by top-level API section (cluster, nodes, etc.).

proxmox_api.parse_apidoc.print_summary(endpoints: list[Endpoint]) None[source]

Print a human-readable summary of all endpoints.

proxmox_api.parse_apidoc.main() None[source]