app.storage.postgres.registrations¶
Source-registration queries of the PostgreSQL store.
Public API: sync_registrations(), get_registration(),
list_registrations(), update_poll_status().
- app.storage.postgres.registrations.REMOVED_FROM_CONFIG = 'registration is no longer in catalog.yaml'¶
config_errorset on registrations no longer in the configuration.
- app.storage.postgres.registrations.sync_registrations(session, registrations)¶
Make stored registrations match the configuration.
- Parameters:
session (
Session) – Unit-of-work session.registrations (
Sequence[RegistrationConfig]) – All configured registrations.
- Return type:
- app.storage.postgres.registrations.get_registration(session, source_id)¶
Fetch one registration.
- Parameters:
session (
Session) – Unit-of-work session.source_id (
str) – Registration id.
- Return type:
- Returns:
The registration, or
None.
- app.storage.postgres.registrations.list_registrations(session)¶
List all registrations ordered by id.
- Parameters:
session (
Session) – Unit-of-work session.- Return type:
- Returns:
The registrations.
- app.storage.postgres.registrations.update_poll_status(session, source_id, status, attempted_at, error)¶
Record the outcome of a poll.
- Parameters:
session (
Session) – Unit-of-work session.source_id (
str) – Registration id.status (
PollStatus) – Poll outcome.attempted_at (
datetime) – When the poll started.error (
JsonValue) – Error details, orNone.
- Raises:
LookupError – If the registration does not exist.
- Return type: