Commit Graph

14 Commits

Author SHA1 Message Date
DavHau
6e281dd7c3 api/machines: better input/output validation
Also move contents tof 'config' to the top-level
2023-11-06 17:56:27 +07:00
Qubasa
e389c7cfe7 Updated to main branch. Removed cluttering asyncio and httpx log messages 2023-10-27 23:36:45 +02:00
Qubasa
916fa8e570 All tests passing babyyy !! 2023-10-27 19:26:03 +02:00
Qubasa
0be3dac289 nix fmt 2023-10-27 19:21:50 +02:00
Qubasa
8ff80b025c Fixing a multitude of tests 2023-10-27 19:21:50 +02:00
DavHau
e6b13fd970 api/machines: split off config validation into separate endpoint
- This speeds up PUT /machines{name}/config as it doesn't do the expensive check anymore
- instead use PUT /machines/{name}/verify which allows a dry-run evaluation of a config which is passed without writing it to disk
2023-10-25 17:48:37 +01:00
DavHau
cf0953146d api/machines: allow importing extra modules
- add top-level option `clanImports` to clanCore
- clanImports can be set and checked as any other option
- buildClan resolves the clanImports from the settings.json before calling evalModules to prevent infinite recursions
- new endpoint PUT machines/{name}/schema to allow getting the schema for a specific list of imports
- to retrieve the currently imported modules, cimply do a GET or PU on machines/{name}/config which will return `clanImports` as part of the config

Still missing: get list of available modules
2023-10-25 16:36:30 +01:00
DavHau
607c52149f PUT /machines/{name}/config; ensure is idempotent 2023-10-24 18:48:14 +01:00
DavHau
177be69eda PUT api/machines/{name}/config: ensure only valid config is ever written
- add CLAN_MACHINE_SETTINGS_FILE variable to temporarily override the machine settings file
- do a dry-run evaluation first with the new config before persisting it.
2023-10-24 18:40:48 +01:00
DavHau
f1e7495806 machines: add endpoint machines/{name}/ verify 2023-10-24 16:31:37 +01:00
Jörg Thalheim
87f0b090ef cli: rename clan_flake to test_flake 2023-09-15 12:36:16 +02:00
Jörg Thalheim
02f421546c rename machine_flake back to clan_flake 2023-09-14 17:06:07 +02:00
Jörg Thalheim
2048ffccb0 drop clan_flake fixture 2023-09-14 16:57:48 +02:00
Jörg Thalheim
451ecbb691 rename test_api_machines test to be consistent with the rest 2023-09-14 13:02:58 +02:00