[pdm-devel] [PATCH datacenter-manager v2 0/3] refactor api caching & try to reuse the cache
Dominik Csapak
d.csapak at proxmox.com
Fri Oct 17 14:00:48 CEST 2025
This series introduces a small refactored struct to access the api cache
(like we used for resources + subscription) so that we don't have to
repeat the same way for every bit of data we want to cache.
It also shows how we can add a mechanism to live update this cache
for e.g. pve resources api call and utilize it when the
remote is not reachable
changes from v2:
* use proper api type to convey that the result was cached
* abstract the 'update, fall back to cache' helper into the ApiCache
struct (it'll probably be useful for more api calls)
* update the cli client for this too
* some smaller things @Lukas mentioned (thanks!)
Dominik Csapak (3):
server: api: resources: change use of remote to reference
server: introduce ApiCache abstraction
api/ui: pve: get cluster resources from cache if remote is unreachable
cli/client/src/pve.rs | 4 +-
lib/pdm-api-types/src/resource.rs | 24 +++
lib/pdm-client/src/lib.rs | 4 +-
server/src/api/pve/mod.rs | 63 ++++---
server/src/api/resources.rs | 163 +++++--------------
server/src/api_cache.rs | 128 +++++++++++++++
server/src/lib.rs | 1 +
server/src/metric_collection/top_entities.rs | 2 +-
ui/src/pve/mod.rs | 27 ++-
9 files changed, 259 insertions(+), 157 deletions(-)
create mode 100644 server/src/api_cache.rs
--
2.47.3
More information about the pdm-devel
mailing list