[pdm-devel] [PATCH proxmox-datacenter-manager 05/16] api: sdn: add list_vnets endpoint
Stefan Hanreich
s.hanreich at proxmox.com
Thu Aug 28 11:01:03 CEST 2025
On 8/27/25 3:45 PM, Dominik Csapak wrote:
[snip]
>> +/// Query VNets of PVE remotes with optional filtering options
>> +async fn list_vnets(
>> + pending: Option<bool>,
>> + running: Option<bool>,
>> + remotes: Option<Vec<String>>,
>> +) -> Result<Vec<ListVnet>, Error> {
>> + let (remote_config, _) = pdm_config::remotes::config()?;
>> +
>> + let remote_ids = remotes.unwrap_or_else(|| {
>> + remote_config
>> + .values()
>> + .filter(|remote| (remote.ty == RemoteType::Pve))
>> + .map(|remote| remote.id.clone())
>> + .collect()
>> + });
>> +
>> + let mut result = Vec::new();
>> +
>> + for remote in remote_ids {
>> + let client = connect(get_remote(&remote_config, &remote)?)?;
>> +
>> + for vnet in client.list_vnets(pending, running).await? {
>> + result.push(ListVnet {
>> + remote: remote.clone(),
>> + vnet,
>> + })
>> + }
>> + }
>
> similar remark as for the other paralallizing stuff (just so we don't
> forget)
>
> we could use a joinset + semaphores in the future to parallelize this
> more, but for now probably good enough
seems like I completely missed the list endpoints when re-visiting this
patch series. I'd say we should definitely parallelize the requests to
the remotes (for all entities zones / vnets / controllers).
More information about the pdm-devel
mailing list