aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-11-26 21:44:10 +0700
committerShulhan <ms@kilabit.info>2023-12-01 13:17:30 +0700
commitd46473cf2d8b224443352c6d5f617a64312af793 (patch)
treeca8524138b6626c51cd7e4ebda4fecb4bb2b5f50 /testdata
parenta73f0d5d0108e2e10d89f93c7867addbe073add9 (diff)
downloadawwan-d46473cf2d8b224443352c6d5f617a64312af793.tar.xz
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 <ms@kilabit.info>
Diffstat (limited to 'testdata')
-rw-r--r--testdata/http_server/execute/local_test.data23
1 files changed, 23 insertions, 0 deletions
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
+
+