DIRACGrid / DIRACGrid/DIRAC

Read adapter: diracx RSS calls + response translation

Open
#8,685 0 comments 0 reactions 1 assignee Claimed by @Loxeris View on GitHub
Dominant language
Python
Stars
126
Forks
191
Avg merge
1d 13h
Merged PRs (30d)
33

Description

### Description

Build a self-contained read adapter module that calls the diracx RSS API (phase 1 routes) and returns data in the legacy format expected by the `ResourceStatus` and `SiteStatus` singletons' cache refresh methods.

The module owns two responsibilities:

1. **Client calls** to the diracx RSS endpoints using the generated diracx client, including iterating over all configured VOs and merging results to match the current `vO="all"` behavior.
2. **Response translation** from diracx `AllowedStatus` / `BannedStatus` Pydantic models into the legacy-shaped structures the singletons build their cache entries from.

The adapter is a temporary shim that will be replaced by a standard legacy adapter once phase 3 ships the write API.

### Scope

- All element types currently handled by the singletons: `StorageElement` (with its 4 access types — read, write, check, remove), `ComputingElement`, `FTS`, and `Site`.
- Mapping from diracx `AllowedStatus` / `BannedStatus` to the structures the singletons build their cache entries from.
- VO handling: iterate over all configured VOs and merge results.

### Non-goals

- No wiring into the singletons (that's sub-issue C).
- No feature flag (that's sub-issue C).
- No caching inside the adapter — the singletons' existing `RSSCache` stays on top.

### Reference

- Phase 1 Pydantic models: DIRACGrid/diracx#837
- Phase 2 main issue (this phase)

### Acceptance criteria

- [ ] Module exposes a function per element type, accepting a diracx client and returning legacy-shaped data.
- [ ] Unit tests against a mocked diracx client cover every element type.
- [ ] Golden tests compare output to the format currently produced by the legacy RPC path.
- [ ] No dependency on DIRAC singletons, or the DIRAC CS.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.