add_node

Function add_node 

Source
pub async fn add_node(
    infra: &InfraContext<'_>,
    token: &str,
    id: &str,
    group: &str,
    enabled: bool,
    arch_opt: Option<String>,
    hardware_file_path: Option<&PathBuf>,
) -> Result<(), Error>
Expand description

Register a new HSM component, attach an optional hardware inventory file, and add it to the named group.

The flow is three writes: post_nodes, then (if hardware_file_path is supplied) post_inventory_hardware after parsing the JSON file, then post_member. Each failure after the initial create rolls back by deleting the node, so a partial failure does not leave a stub component behind. Hardware-file parse errors are reported as the original IO / serde error, with the same rollback applied.