shutdown_host(): POST /nodes/{node}/status with command=shutdown, next to reboot_host(). A refusal is a RuntimeError.
begin_stop_vm(name): POST …/status/shutdown for a VM or container, found by vmid or name. It returns once Proxmox took the request and does not wait for the task. stop_vm waits at most 120 s, and a guest with down=300 can take longer. An unknown guest is a ValueError, a refusal a RuntimeError.
The driver does not import the new mixins yet, because napalm_device_types>=4.22.0 does not have them; netOrk asks with hasattr. Mixing them in can come with the next device-types release.
CHANGELOG (Unreleased).
Testing
tests/test_shutdown_requests.py (7): the request sent, no task waited for, VM and container, by name and by vmid, unknown guest, refusal.
Full suite: 350 passed (with device-types from #55 on the path). ruff, format and mypy are clean.
## Summary
`shutdown_host()` and `begin_stop_vm(name)` for netOrk's graph workflows, which shut pve-dual down when CI has nothing for build-01 (NetOrk/netork#1636, epic NetOrk/netork#1633). They implement the contracts of NAPALM/napalm-device-types#55.
## Changes
- `shutdown_host()`: `POST /nodes/{node}/status` with `command=shutdown`, next to `reboot_host()`. A refusal is a `RuntimeError`.
- `begin_stop_vm(name)`: `POST …/status/shutdown` for a VM or container, found by vmid or name. It returns once Proxmox took the request and does not wait for the task. `stop_vm` waits at most 120 s, and a guest with `down=300` can take longer. An unknown guest is a `ValueError`, a refusal a `RuntimeError`.
- The driver does not import the new mixins yet, because `napalm_device_types>=4.22.0` does not have them; netOrk asks with `hasattr`. Mixing them in can come with the next device-types release.
- CHANGELOG (Unreleased).
## Testing
- `tests/test_shutdown_requests.py` (7): the request sent, no task waited for, VM and container, by name and by vmid, unknown guest, refusal.
- Full suite: 350 passed (with device-types from #55 on the path). ruff, format and mypy are clean.
shutdown_host() posts command=shutdown to the node itself; its guests
stop as on any shutdown. begin_stop_vm(name) asks a guest for its clean
shutdown and returns once Proxmox took it, without waiting for the
task: the caller reads get_vm_status until it stopped. Both raise
RuntimeError when Proxmox refuses; an unknown guest is a ValueError.
The contracts HostShutdownMixin and VmStopRequestMixin of
napalm-device-types (NAPALM/napalm-device-types#55); for netOrk's graph
workflows (NetOrk/netork#1636).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
shutdown_host()andbegin_stop_vm(name)for netOrk's graph workflows, which shut pve-dual down when CI has nothing for build-01 (NetOrk/netork#1636, epic NetOrk/netork#1633). They implement the contracts of NAPALM/napalm-device-types#55.Changes
shutdown_host():POST /nodes/{node}/statuswithcommand=shutdown, next toreboot_host(). A refusal is aRuntimeError.begin_stop_vm(name):POST …/status/shutdownfor a VM or container, found by vmid or name. It returns once Proxmox took the request and does not wait for the task.stop_vmwaits at most 120 s, and a guest withdown=300can take longer. An unknown guest is aValueError, a refusal aRuntimeError.napalm_device_types>=4.22.0does not have them; netOrk asks withhasattr. Mixing them in can come with the next device-types release.Testing
tests/test_shutdown_requests.py(7): the request sent, no task waited for, VM and container, by name and by vmid, unknown guest, refusal.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.