Skip to content

Commit 90f8dbc

Browse files
committed
feat(api): added report_app_ready interface
1 parent 4bc7f60 commit 90f8dbc

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎system/cuos/api.sh‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,20 @@ EOF
204204
}' | jq -s .
205205
;;
206206

207+
## report_app_ready - App announces itself as ready.
208+
"report_app_ready")
209+
message="$(echo "${INPUT}" | jq -r '.message // ""')"
210+
report_info "cuos:startup:done" "Startup complete${message+" – ${message}"}"
211+
;;
212+
## report - Write a report
213+
"report")
214+
id="$(echo "${INPUT}" | jq -r '.id // "cuos:userreport:other"')"
215+
message="$(echo "${INPUT}" | jq -r '.message // ""')"
216+
level="$(echo "${INPUT}" | jq -r '.level // ""')"
217+
218+
logger -t cuos -p "daemon.${level}" "${id}" "${message}"
219+
;;
220+
207221
## app - Call app API
208222
"app")
209223
echo "${INPUT}" | docker exec -i cuos-app /api/trigger "$@"

‎system/cuos/app-init.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,6 @@ fi
186186

187187
state '.state' 'running'
188188

189-
report_info "cuos:startup:done" "Operation System and Init Container successfully started."
189+
report_info "cuos:startup:ready" "Operation system ready. Starting applications ..."
190190

191191
sleep infinity & wait

‎system/cuos/init.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ main() {
696696
exit "$?"
697697
fi
698698
else
699-
report_info "cuos:init:start" "System startup"
699+
report_info "cuos:startup:start" "System starting up ..."
700700
state jq '.start_date = (now | todate)'
701701
fi
702702

0 commit comments

Comments
 (0)