Files
DECNET/decnet/web/router/deckies/__init__.py
anti 5f4005c47a feat(tarpit): port-selective tc netem tarpit mode with live log events
- GET/POST/DELETE /api/v1/deckies/{name}/tarpit (admin write, viewer GET)
- get_container_veth() + get_container_pid() in network.py via iflink/ip-link
- TarpitRule SQLModel table + TarpitMixin repo (upsert/get/delete/list)
- Background tarpit_watcher_worker: polls /proc/{pid}/net/tcp every 15s,
  emits tarpit_enter/tarpit_exit log events (edge-triggered, with duration)
- tarpit_enabled/tarpit_disabled logs on operator POST/DELETE actions
2026-04-29 18:49:42 -04:00

34 lines
1.1 KiB
Python

"""Cross-cutting decky operation endpoints.
These routes apply to both fleet and MazeNET (topology) deckies; the
MazeNET case is selected by passing ``topology_id`` in the request body.
Compare with:
* :mod:`decnet.web.router.fleet` — fleet-only CRUD (deploy, mutate,
list).
* :mod:`decnet.web.router.topology` — topology-only CRUD.
"""
from __future__ import annotations
from fastapi import APIRouter
from .api_file_drop import router as file_drop_router
from .api_services import (
fleet_services_router,
topology_services_router,
)
from .api_tarpit import router as tarpit_router
deckies_router = APIRouter()
deckies_router.include_router(file_drop_router)
deckies_router.include_router(fleet_services_router)
# Topology service routes live under /topologies/{id}/... — the prefix
# is set on the router itself. Mounted under the same `deckies_router`
# umbrella because the *operation* (add/remove a service on a deployed
# decky) is identical; only the addressing scheme differs.
deckies_router.include_router(topology_services_router)
deckies_router.include_router(tarpit_router)
__all__ = ["deckies_router"]