feat(api): per-service config schema endpoint + PUT/POST update+apply for fleet & topology

- GET /topologies/services/{name}/schema serves the declared ServiceConfigField
  metadata so the Inspector can auto-render forms.
- PUT  /(topologies/{id}/)deckies/{decky}/services/{svc}/config persists the
  validated dict (DB + compose); container untouched (Save).
- POST /(topologies/{id}/)deckies/{decky}/services/{svc}/apply persists then
  force-recreates <decky>-<svc> so the new env takes effect (Apply, destructive).
- New engine helper update_service_config wires both fleet and topology paths
  through the existing _persist_fleet_change / _rerender_topology_compose
  machinery; emits decky.<name>.service_config_changed on the bus.
This commit is contained in:
2026-04-29 11:38:06 -04:00
parent 54b1fbed14
commit 75b1ce3a31
8 changed files with 693 additions and 1 deletions

View File

@@ -67,7 +67,11 @@ from .decky import (
DeckyFileDeleteRequest,
DeckyFileDropRequest,
DeckyServiceAddRequest,
DeckyServiceConfigRequest,
DeckyServiceConfigResponse,
DeckyServicesResponse,
ServiceConfigFieldDTO,
ServiceSchemaResponse,
)
from .fleet import (
LOCAL_HOST_SENTINEL,
@@ -231,8 +235,12 @@ __all__ = [
"DeckyFileDeleteRequest",
"DeckyFileDropRequest",
"DeckyServiceAddRequest",
"DeckyServiceConfigRequest",
"DeckyServiceConfigResponse",
"DeckyServicesResponse",
"FleetDecky",
"ServiceConfigFieldDTO",
"ServiceSchemaResponse",
# health
"ComponentHealth",
"HealthResponse",