From d46473cf2d8b224443352c6d5f617a64312af793 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 26 Nov 2023 21:44:10 +0700 Subject: all: implement HTTP API to fetch execution output by ID The new API is "GET /awwan/api/execute/tail" that implement Server-sent events, not a normal GET request. Its accept the query parameter "id" with value is the execution ID from "/awwan/api/execute". Once called with valid ID, it will streaming the command output to client. By using this new API, the WUI can receive the output of command immediately without waiting for all commands to be completed. Implements: https://todo.sr.ht/~shulhan/awwan/5 Signed-off-by: Shulhan --- testdata/http_server/execute/local_test.data | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'testdata/http_server') diff --git a/testdata/http_server/execute/local_test.data b/testdata/http_server/execute/local_test.data index 1720bd8..a64b049 100644 --- a/testdata/http_server/execute/local_test.data +++ b/testdata/http_server/execute/local_test.data @@ -20,3 +20,26 @@ }, "code": 200 } + +<<< local:/local.aww:1-:tail +event: open + +event: begin +data: 2023-11-26T15:21:00Z + +event: message +data: - local.aww === BEGIN: local /local.aww 1- + +event: message +data: - local.aww --> 1: echo "test" + +event: message +data: test + +event: message +data: - local.aww === END + +event: end +data: 2023-11-26T15:21:00Z + + -- cgit v1.3