Expand description
Hardware cluster pin/unpin and hw-component add/delete service logic.
Split into three (private) sub-modules:
scoring— pure-computation functions for component scarcity, per-node scoring, candidate selection, pattern parsing, and the parallel hw-inventory fetcher. Also hostsresolve_hw_description_to_xnames, which dispatches between pin and unpin.pin_unpin— thecalculate_target_hsm_pin/_unpinnode selection algorithms plus the shared coordination helpers used byapply_hw_configuration(pattern parsing, target-group existence check, resource-sufficiency validation, group-update orchestration).apply— high-level coordinators called by the server handlers:apply_hw_configuration,add_hw_component,delete_hw_component.
Public types (AddHwResult, DeleteHwResult, ApplyHwResult,
NodeHwCountVec, HwClusterMode) and shared constants live here
so all three sub-modules can use them.
Structs§
- AddHw
Result - Result of an
add hw-componentoperation. - Apply
HwResult - Result of an
apply hw-configuration(pin/unpin) operation. - Delete
HwResult - Result of a
delete hw-componentoperation.
Enums§
- HwCluster
Mode - Whether the hw cluster operation moves nodes into the target (Pin) or releases them back (Unpin).
Functions§
- add_
hw_ component - Core logic for adding hardware components to a cluster group. No terminal interaction — suitable for both CLI and HTTP callers.
- apply_
hw_ configuration - Core logic for hardware cluster pin/unpin — no terminal interaction.
- delete_
hw_ component - Core logic for removing hardware components from a cluster group. No terminal interaction — suitable for both CLI and HTTP callers.
Type Aliases§
- Node
HwCount Vec - A list of nodes paired with their per-component counts.