aboutsummaryrefslogtreecommitdiff
path: root/testdata/http_server/execute
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-11-22 13:16:21 +0700
committerShulhan <ms@kilabit.info>2023-12-01 13:17:30 +0700
commita73f0d5d0108e2e10d89f93c7867addbe073add9 (patch)
tree042e69e2c1d10d836a006abca37417af02bba826 /testdata/http_server/execute
parenta9701f66c2e38a3a7f3d12deed6ebba5144e208e (diff)
downloadawwan-a73f0d5d0108e2e10d89f93c7867addbe073add9.tar.xz
all: refactoring HTTP endpoint for Execute
Previously, the Execute endpoint wait for command execution to finish. In case the command takes longer than proxy or server write timeout, it will return with an timeout error to client. In this changes, we generate an execution ID for each request and return it immediately. The next commit will implement HTTP endpoint to fetch the latest status and/or output by execution ID. References: https://todo.sr.ht/~shulhan/awwan/5
Diffstat (limited to 'testdata/http_server/execute')
-rw-r--r--testdata/http_server/execute/local.aww1
-rw-r--r--testdata/http_server/execute/local_test.data22
2 files changed, 23 insertions, 0 deletions
diff --git a/testdata/http_server/execute/local.aww b/testdata/http_server/execute/local.aww
new file mode 100644
index 0000000..3832772
--- /dev/null
+++ b/testdata/http_server/execute/local.aww
@@ -0,0 +1 @@
+echo "test"
diff --git a/testdata/http_server/execute/local_test.data b/testdata/http_server/execute/local_test.data
new file mode 100644
index 0000000..1720bd8
--- /dev/null
+++ b/testdata/http_server/execute/local_test.data
@@ -0,0 +1,22 @@
+
+>>> local:/local.aww:1-
+{
+ "mode": "local",
+ "script": "/local.aww",
+ "line_range": "1-"
+}
+
+<<< local:/local.aww:1-
+{
+ "data": {
+ "mode": "local",
+ "script": "/local.aww",
+ "line_range": "1-",
+ "id": "local:/local.aww:1-:1701012060",
+ "begin_at": "2023-11-26T15:21:00Z",
+ "end_at": "",
+ "error": "",
+ "output": []
+ },
+ "code": 200
+}