feat: Proxmox VE 9.3 API additions (NetOrk/netork#2728)

On a node running 9.3: HA maintenance over PUT /nodes/{node}/maintenance
(the target node's version decides, SSH below it), the guest uid in
get_vms, the cluster-id as ClusterDict.id, sync-time-on-resume on resume.
get_credential_expiry reads the expiry of the token or account the driver
logged in with; get_update_history lists the node's APT transactions.
Needs napalm-device-types 4.44.0.
This commit is contained in:
Christian Manivong committed 2026-11-26 17:35:50 +01:00
1 parent c2d9d7e75e
commit fddf8af680
17 files changed
+718 -17

No files matched your search

+29
View File
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Proxmox VE 9.3's API additions (NetOrk/netork#2728), each taken only on a node whose
`GET /version` says 9.3 or later (`_version_at_least`); an older node does what it did.
- `get_vms()`: each guest carries PVE 9.3's `uid`, an identity that survives a migration, a
restore and a changed vmid, from one `GET /cluster/resources?type=vm` per call, joined by
node and vmid (napalm-device-types `VMDict.uid`). A guest without one, an older node and a
listing that cannot be read leave the key out; the guests are listed as before.
- `get_clusters()`: `id` is the cluster's `cluster-id` from `GET /cluster/status`, or a
standalone node's own on its node entry; None on an older node.
- `get_credential_expiry()` (napalm-device-types `CredentialExpiryMixin`): the API token
(`GET /access/users/{userid}/token/{tokenid}`) or the password's account
(`GET /access/users/{userid}`) the driver logged in with, and when it expires; a token
without an `expire` of its own expires with its user. A 403 is a `PermissionError`, any
other failure a `RuntimeError`.
- `get_update_history(since)` (napalm-device-types `UpdateMixin`): the node's APT
transactions from `GET /nodes/{node}/apt/history`, newest first, with `id`
`"{start-time}-{start-index}"`. A failed read raises; before 9.3 it is
`NotImplementedError` (no log is parsed over SSH).
### Changed
- `set_node_maintenance()` uses `PUT /nodes/{node}/maintenance` when the node going into
maintenance runs PVE 9.3, and opens no SSH session; that node's own version decides,
since a rolling upgrade leaves the members on different releases. An older node still
takes `ha-manager crm-command node-maintenance` over SSH.
- `resume_vm()` sets the guest's clock to the host's time on PVE 9.3
(`sync-time-on-resume=1`, through the guest agent where it runs).
- Needs napalm-device-types 4.44.0 or later (`CredentialExpiryMixin`, `UpdateHistoryDict`,
`VMDict.uid`).
## [0.13.0] - 2026-11-26
### Added