- Issues
- #140
Add a way to list Durable Object instances
blackrabbit opened ·
## Use case
While using celld, I needed to enumerate all Durable Object instances in a deployment. I ended up maintaining my own index inside another Durable Object, but for an operational task I really just wanted celld to list the objects it already knows about.
This is about listing **Durable Object instances**, not listing keys inside one object's `state.storage` (which already has `storage.list()`).
## Proposed surface
A standalone/operator-facing command would avoid adding a celld-only method to `DurableObjectNamespace`, for example:
```sh celld cells --bucket s3://my-cells-bucket ```
It could initially print the durable cell scope/ID, with JSON output and class filtering as possible follow-ups. The normal `--endpoint` and `--region` options should apply.
## Why this seems feasible
The bucket layout already has one prefix per durable cell under `cells/<cell>/`, and managed control-plane explorer code already implements a paginated `list_cells` operation using `common_prefixes("cells/")`. The missing piece appears to be a supported surface for standalone users.
## Semantics to clarify
- Does “all” mean every cell with replicated durable state, including currently hibernated cells? (That is the useful definition for my case.) - Cells addressed but never instantiated / never written presumably should not appear. - Named IDs cannot necessarily recover their original name from the prefix alone, so returning the class and ID first would still be useful. - Listing should be paginated/streamed rather than requiring all cell prefixes in memory for large deployments.
Would a CLI command be the right API, or should this be exposed through an authenticated administrative endpoint instead?
- BL
I implemented a testable version on a public branch: https://github.com/blackrabbit/celld/tree/feature/list-cells (commit [`67ada32`](https://github.com/blackrabbit/celld/commit/67ada32)). It adds `celld cells`, `--class`, and `--json`, plus parser/listing tests and docs. I ran rustfmt on the changed Rust module; local tests are currently blocked because this environment has no C linker.
- BL
Update: I installed a local Zig-based C linker and reran the targeted tests. Both `fleet::tests` pass (`2 passed, 0 failed`).
- BL
Added an opt-in live object-store test in [`86926f1`](https://github.com/blackrabbit/celld/commit/86926f1). It writes a uniquely named temporary `cells/<scope>/...` object, verifies the delimiter listing and class filter find it, and cleans it up. The normal test suite now reports 3 passing `fleet::tests`; the live S3 path is gated by `CELLD_CELLS_LIVE=1`.
- BA
This one is now done as of v0.4.0: https://github.com/denoland/celld/releases/tag/v0.4.0