Class: Pvectl::Repositories::Capabilities
- Defined in:
- lib/pvectl/repositories/capabilities.rb
Overview
Repository for Proxmox node capabilities.
Aggregates feature information from the two most useful capability endpoints — QEMU CPU models and QEMU machine types — into a flat collection of Capability models. The cpu-flags and migration capability endpoints are intentionally out of scope for the initial implementation (YAGNI); they can be added when there is a concrete consumer need.
Constant Summary collapse
- CPU_ENDPOINT =
CPU capability endpoint path (without leading slash).
"capabilities/qemu/cpu"- MACHINES_ENDPOINT =
Machine type capability endpoint path (without leading slash).
"capabilities/qemu/machines"
Instance Method Summary collapse
-
#list(node:) ⇒ Array<Models::Capability>
Lists capabilities for a node.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Pvectl::Repositories::Base
Instance Method Details
#list(node:) ⇒ Array<Models::Capability>
Lists capabilities for a node.
Combines ‘GET /nodes/node/capabilities/qemu/cpu` and `GET /nodes/node/capabilities/qemu/machines`. Each entry becomes a Capability instance — CPU models first, then machine types.
38 39 40 41 42 |
# File 'lib/pvectl/repositories/capabilities.rb', line 38 def list(node:) raise ArgumentError, "node is required" if node.nil? || node.to_s.empty? cpus(node) + machines(node) end |