flip_api.db.seed.fl_nets ======================== .. py:module:: flip_api.db.seed.fl_nets Attributes ---------- .. autoapisummary:: flip_api.db.seed.fl_nets.nets Functions --------- .. autoapisummary:: flip_api.db.seed.fl_nets.seed_fl_nets Module Contents --------------- .. py:function:: seed_fl_nets(session: sqlmodel.Session) -> list[flip_api.db.models.main_models.FLNets] Upsert FL nets in the database from ``NET_ENDPOINTS``. Rows are matched by ``name`` and their ``endpoint`` reconciled to the value in ``NET_ENDPOINTS`` on every startup. The previous behaviour was insert-only and skipped on name conflict, which silently stranded stale endpoints after the EC2-compose → ECS Cloud Map migration (rows seeded with the old `http://flip-fl-api-net-1:8000` docker-compose hostname survived alongside the new `http://fl-api-net-1.flip.local:8000` service discovery URL in the env, breaking `/api/fl/status` with `Name or service not known`). NET_ENDPOINTS is the canonical source — operator changes to the row's endpoint via SQL would also be overwritten on the next start, which is the intended behaviour. :param session: The SQLModel session used to read existing FL nets and upsert entries from ``NET_ENDPOINTS``. :type session: Session :returns: All FL net rows present after seeding. :rtype: list[FLNets] .. py:data:: nets