Add /api/action/gravity which can be used to trigger a run of pihole -g. The output is live streamed using HTTP/1.1 chunked encoding.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-01-24 20:15:45 +01:00
parent f9a9f3aa8f
commit e4383775d1
11 changed files with 210 additions and 4 deletions
+5
View File
@@ -50,6 +50,11 @@ if __name__ == "__main__":
# matches the OpenAPI specs.
print("Verifying the individual endpoint properties...")
for path in openapi.endpoints["get"]:
# We do not check the action endpoints as they'd trigger
# possibly unwanted action such as restarting FTL, running
# gravity, stutting down the system, etc.
if path.startswith("/api/action"):
continue
verifyer = ResponseVerifyer(ftl, openapi)
errors = verifyer.verify_endpoint(path)
if len(errors) == 0: