You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wire the data models #837 and caching infrastructure #838 together: implement ResourceStatusSource(CacheableSource) that reads from ResourceStatusDB and serves resource status through a new config route.
Scope
ResourceStatusSource: a CacheableSource subclass that:
Reads from ResourceStatusDB (Site + Resource status tables)
Translates DB status values (Active/Degraded/Banned/...) to the binary Pydantic models (AllowedStatus/BannedStatus)
Implements latest_revision() — e.g. hash of current status snapshot, or max DateEffective/LastCheckTime
Implements read_raw() — returns the full status dict per resource type and VO
Description
Wire the data models #837 and caching infrastructure #838 together: implement
ResourceStatusSource(CacheableSource)that reads fromResourceStatusDBand serves resource status through a new config route.Scope
ResourceStatusSource: aCacheableSourcesubclass that:ResourceStatusDB(Site + Resource status tables)Active/Degraded/Banned/...) to the binary Pydantic models (AllowedStatus/BannedStatus)latest_revision()— e.g. hash of current status snapshot, or maxDateEffective/LastCheckTimeread_raw()— returns the full status dict per resource type and VORoute: new endpoint under the config router:
Equivalent endpoints for compute and site status.
Access policy: any authenticated user can read (similar to current config endpoint being
@open_access, but scoped to the user's VO).Integration tests: verify end-to-end flow from DB data to API response, including HTTP caching headers (ETag / 304 Not Modified).
Technical details
ResourceStatusSourcelives indiracx-core/src/diracx/core/config/or a newdiracx-core/src/diracx/core/rss/packageResourceStatusSourceneeds access toResourceStatusDB— design the wiring so it fits the existing DI patternsReference
diracx-routers/src/diracx/routers/configuration.pydiracx-routers/src/diracx/routers/dependencies.pyAcceptance criteria
ResourceStatusSource(CacheableSource)reads fromResourceStatusDBand produces Pydantic status models