feat: export reqs

This commit is contained in:
Andrey Egorov
2025-10-20 15:30:57 +03:00
parent 30279f4649
commit 2235e7eb71

20
req.sh
View File

@@ -56,8 +56,24 @@ elif [[ $1 == "export-backup" ]]; then
"$ADDR/data/backup/export" --output export.zip
elif [[ $1 == "export-logs" ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
-d '{ "devices": ["KerbClientEmulat"], "start": 1, "end": 1748442522, "timezone": "GMT+03:00"}' \
-d "{ \"devices\": [\"A56AF66F17D902B8\"], \"start\": 1, \"end\": $(date +%s), \"timezone\": \"GMT+03:00\"}" \
"$ADDR/data/logs/exportLogsReport" | jq
elif [[ $1 == "export-alarms" ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
-d "{ \"devices\": [\"A56AF66F17D902B8\"], \"start\": 1, \"end\": $(date +%s), \"timezone\": \"GMT+03:00\"}" \
"$ADDR/data/alarms/exportIncidentsReport" | jq
elif [[ $1 == "export-sensors-readings" ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
-d "{ \"devices\": [\"A56AF66F17D902B8\"], \"sensors\": [\"TEMPERATURE/85\"], \"start\": 1, \"end\": $(date +%s), \"timezone\": \"GMT+03:00\"}" \
"$ADDR/data/sensors/exportSensorReadings" | jq
elif [[ $1 == "export-alarm-settings" ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
-d "{ \"devices\": [\"A56AF66F17D902B8\"] }" \
"$ADDR/data/alarms/exportIncidentDetectionSensorSettingsReport" | jq
elif [[ $1 == "export-vehicle" ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
-d "{ \"devices\": [\"A56AF66F17D902B8\"] }" \
"$ADDR/data/exportVehiclesReport" | jq
elif [[ $1 == "get-from-redis" ]]; then
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
"$ADDR/data/getDataFromRedis?fileID=$2"
@@ -67,7 +83,7 @@ elif [[ $1 == "alarms-amount" ]]; then
"$ADDR/data/alarms/getAlarmsAmount" | jq
elif [[ $1 == "alarms" ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
-d "{ \"devices\": [\"A56AF66F17D902B8\"], \"start_time\": $(($(date +%s)-5000)), \"end_time\": $(date +%s), \"order\": [[\"sensor_id\", \"+\"]], \"page_number\": 1, \"page_size\": 30}" \
-d "{ \"devices\": [\"A56AF66F17D902B8\"], \"start_time\": 1, \"end_time\": $(date +%s), \"order\": [[\"sensor_id\", \"+\"]], \"page_number\": 1, \"page_size\": 30}" \
"$ADDR/data/alarms/getAlarms" | jq
elif [[ $1 == "geo" ]]; then
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \