Skip to content

API monitoring

API monitoring #2900

Workflow file for this run

name: API monitoring
on:
schedule:
- cron: "1 * * * *"
jobs:
all:
runs-on: ubuntu-latest
steps:
- name: read models file
id: read
run: |
echo "./models.json"
cat ./models.json
- name: testing models
id: testing
run: |
KEYS=$(jq 'keys[]' "${{ steps.read.outputs.path }}")
for key in $KEYS; do
API_URL=$(jq -r ".[$key].api" "${{ steps.read.outputs.path }}")
HEADERS=$(jq -r ".[$key].headers[]" "${{ steps.read.outputs.path }}")
DATA=$(jq -r ".[$key].data" "${{ steps.read.outputs.path }}")
echo "You online?"
curl -X POST \
"$API_URL" \
-H "$HEADERS" \
-d "$DATA"
done