delete_hw_component

Function delete_hw_component 

Source
pub async fn delete_hw_component(
    infra: &InfraContext<'_>,
    token: &str,
    target_group_name: &str,
    parent_group_name: &str,
    pattern: &str,
    dryrun: bool,
    delete_group: bool,
) -> Result<DeleteHwResult, Error>
Expand description

Move enough nodes out of target_group_name back into parent_group_name to remove the components described by pattern from the target.

The target group must already exist (returns NotFound otherwise). When the target is already empty the routine short-circuits, optionally deleting the empty group if delete_group is set. Selection scores combine both groups’ scarcity, so the move keeps the most scarce hardware in the target group whenever possible. After moving, the function deletes the target group if it ended up empty and delete_group is true. dryrun returns the planned move without touching the backend.