[pdm-devel] [PATCH proxmox-datacenter-manager v2 2/4] api: firewall: add option, rules and status endpoints

Hannes Laimer h.laimer at proxmox.com
Mon Nov 10 15:56:08 CET 2025


On 11/7/25 13:27, Lukas Wagner wrote:
>> +    for (vmid, name, kind) in guests {
>> +        let options_response = match kind {
>> +            GuestKind::Lxc => pve.lxc_firewall_options(&node, vmid),
>> +            GuestKind::Qemu => pve.qemu_firewall_options(&node, vmid),
>> +        };
>> +        let rules_response = match kind {
>> +            GuestKind::Lxc => pve.list_lxc_firewall_rules(&node, vmid),
>> +            GuestKind::Qemu => pve.list_qemu_firewall_rules(&node, vmid),
>> +        };
>> +
>> +        let enabled = options_response
>> +            .await
>> +            .map(|opts| opts.enable.unwrap_or_default());
>> +        let rules = rules_response.await.map(|rules| {
>> +            let all = rules.len();
>> +            let active = rules.iter().filter(|r| r.enable == Some(1)).count();
>> +            RuleStat { all, active }
>> +        });
> 
> I think technically you could use join to await both futures at the same
> time, which essentially will perform both requests at the same time.
> 
> But since I guess then this would need to be considered in the
> connection limits for the ParallelFetcher somehow

Thought the same thing. Since we have a ParallelFetcher I wanted to
have it do all of the parallel fetching :P




More information about the pdm-devel mailing list