app.routers.sources¶
HTTP routes for source registration status and operator polls.
GET /api/v1/sources (read) reports the configuration and
freshness of every registration; the stale flag uses
ADRIANO_STALE_AFTER_MINUTES (see
app.services.sources_view.is_stale()).
POST /api/v1/sources/poll and POST /api/v1/sources/{id}/poll
(operate) validate the request, then run the polling service in a
background worker thread and answer 202 with the accepted
registration ids. Unknown id: 404; disabled or push-only registration
(or nothing pollable at all): 409. Progress is visible through
GET /api/v1/sources. See app.services.poll_trigger.
- app.routers.sources.list_sources(provider=Depends(dependency=<function get_store_provider>, use_cache=True, scope=None), runtime=Depends(dependency=<function get_catalog_runtime>, use_cache=True, scope=None), settings=Depends(dependency=<functools._lru_cache_wrapper object>, use_cache=True, scope=None))¶
List every stored source registration.
- Parameters:
provider (
CatalogStoreProvider) – Storage provider (overridden by tests).runtime (
CatalogRuntime|None) – Startup configuration state.settings (
Settings) – Application settings (for the stale threshold).
- Return type:
- Returns:
One entry per stored registration, ordered by id.
- app.routers.sources.poll_all_sources(background, principal=Depends(dependency=<function require_permission.<locals>._check>, use_cache=True, scope=None), runtime=Depends(dependency=<function get_catalog_runtime>, use_cache=True, scope=None), provider=Depends(dependency=<function get_store_provider>, use_cache=True, scope=None))¶
Poll every pollable registration in the background.
- Parameters:
background (
BackgroundTasks) – Background task queue.principal (
Principal) – The operator (operatepermission).runtime (
CatalogRuntime|None) – Startup state.provider (
CatalogStoreProvider) – Storage provider (overridden by tests).
- Return type:
- Returns:
The accepted ids (HTTP 202).
- Raises:
app.errors.ConflictError – If nothing is pollable.
- app.routers.sources.poll_one_source(source_id, background, principal=Depends(dependency=<function require_permission.<locals>._check>, use_cache=True, scope=None), runtime=Depends(dependency=<function get_catalog_runtime>, use_cache=True, scope=None), provider=Depends(dependency=<function get_store_provider>, use_cache=True, scope=None))¶
Poll one registration in the background.
- Parameters:
source_id (
str) – Registration id.background (
BackgroundTasks) – Background task queue.principal (
Principal) – The operator (operatepermission).runtime (
CatalogRuntime|None) – Startup state.provider (
CatalogStoreProvider) – Storage provider (overridden by tests).
- Return type:
- Returns:
The accepted id (HTTP 202).
- Raises:
app.errors.NotFoundError – If the id is not configured.
app.errors.ConflictError – If it cannot be polled.