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
The Pelican integration currently exposes four operations in api/routes/pelican_routes.py:
Operation
Route
list / ls
GET /pelican/browse (plus GET /pelican/info for a single object)
download / wget
GET /pelican/download
import into the catalog
POST /pelican/import-metadata
Two operations have no equivalent in the API:
read — return the contents of an object (a file, an origin, or the object referenced by an event) in the response body, instead of streaming it to disk as /download does. This is the operation a caller needs in order to feed the contents straight into their own code without a temporary file.
subscribe — subscribe to the events of a namespace.
That both already work in the ndp-ep client library is taken from the demo shown on the call; the library is not a dependency of this repository and was not checked here. Confirm against the library before implementing, since it determines how much of this is wiring versus new work.
upload is explicitly out of scope for now.
Design question for subscribe
subscribe is a long-lived stream, which does not map onto a plain request/response route. Three options, to be decided before implementation:
Server-Sent Events — GET /pelican/subscribe returning a text/event-stream. Simplest to implement on top of the existing async stack and easy to consume from both Python and the browser, but holds a worker connection open per subscriber.
Webhook — the caller registers a callback URL and the endpoint POSTs each event to it. Scales better and survives client restarts, but requires the caller to be reachable, plus storage and lifecycle management for the registrations.
Polling with a cursor — the endpoint buffers events and the caller polls for those newer than a cursor. No long-lived connections, but adds latency and a buffer that needs bounding.
Context
The Pelican integration currently exposes four operations in
api/routes/pelican_routes.py:lsGET /pelican/browse(plusGET /pelican/infofor a single object)wgetGET /pelican/downloadPOST /pelican/import-metadataTwo operations have no equivalent in the API:
/downloaddoes. This is the operation a caller needs in order to feed the contents straight into their own code without a temporary file.That both already work in the
ndp-epclient library is taken from the demo shown on the call; the library is not a dependency of this repository and was not checked here. Confirm against the library before implementing, since it determines how much of this is wiring versus new work.uploadis explicitly out of scope for now.Design question for
subscribesubscribeis a long-lived stream, which does not map onto a plain request/response route. Three options, to be decided before implementation:GET /pelican/subscribereturning atext/event-stream. Simplest to implement on top of the existing async stack and easy to consume from both Python and the browser, but holds a worker connection open per subscriber.Acceptance
tests/test_pelican_routes.pystyle.CHANGELOG.mdentry and any new setting added toexample.env.