Compare commits
3 Commits
2235e7eb71
...
79157cbe7e
| Author | SHA1 | Date | |
|---|---|---|---|
|
79157cbe7e
|
|||
|
|
cd01167b9c | ||
|
|
f8ca391cb2 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,3 +2,5 @@
|
|||||||
tmp.token
|
tmp.token
|
||||||
ready_params.json
|
ready_params.json
|
||||||
backups/
|
backups/
|
||||||
|
.env
|
||||||
|
#tmp**/
|
||||||
|
|||||||
52
req.sh
52
req.sh
@@ -1,15 +1,33 @@
|
|||||||
#ADDR=api-fema.ekatgortrans.ru:39080
|
#CFG="LOCAL"
|
||||||
#ADDR=https://api.fema.krbl.ru
|
# CFG="POLYGON"
|
||||||
#ADDR=62.217.183.88:8080
|
CFG="KRBL"
|
||||||
ADDR=0.0.0.0:8080/api/v1
|
# CFG="EKB"
|
||||||
LOGIN=admin
|
|
||||||
PASSWORD=admin
|
|
||||||
#PASSWORD=IR7?BoouErjhXsxg
|
|
||||||
#PASSWORD=ra8KvcMxS2baUxe*
|
|
||||||
#MASTER_CODE=685658
|
|
||||||
MASTER_CODE=111111
|
|
||||||
MFA_OFF="YES"
|
|
||||||
|
|
||||||
|
#MFA_OFF="YES"
|
||||||
|
|
||||||
|
source .env
|
||||||
|
|
||||||
|
if [ $CFG == "LOCAL" ]; then
|
||||||
|
ADDR=$LOCAL_ADDR
|
||||||
|
LOGIN=$LOCAL_LOGIN
|
||||||
|
PASSWORD=$LOCAL_PASSWORD
|
||||||
|
MASTER_CODE=$LOCAL_MASTER_CODE
|
||||||
|
elif [ $CFG == "EKB" ]; then
|
||||||
|
ADDR=$EKB_ADDR
|
||||||
|
LOGIN=$EKB_LOGIN
|
||||||
|
PASSWORD=$EKB_PASSWORD
|
||||||
|
MASTER_CODE=$EKB_MASTER_CODE
|
||||||
|
elif [ $CFG == "KRBL" ]; then
|
||||||
|
ADDR=$KRBL_ADDR
|
||||||
|
LOGIN=$KRBL_LOGIN
|
||||||
|
PASSWORD=$KRBL_PASSWORD
|
||||||
|
MASTER_CODE=$KRBL_MASTER_CODE
|
||||||
|
elif [ $CFG == "POLYGON" ]; then
|
||||||
|
ADDR=$POLYGON_ADDR
|
||||||
|
LOGIN=$POLYGON_LOGIN
|
||||||
|
PASSWORD=$POLYGON_PASSWORD
|
||||||
|
MASTER_CODE=$POLYGON_MASTER_CODE
|
||||||
|
fi
|
||||||
|
|
||||||
#set -x
|
#set -x
|
||||||
|
|
||||||
@@ -40,6 +58,10 @@ elif [[ $1 == "update-user" ]]; then
|
|||||||
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
||||||
-d "{\"username\": \"admin\", \"email\": \"yotia@unprism.ru\", \"full_name\": \"oaf\", \"is_admin\": true}" \
|
-d "{\"username\": \"admin\", \"email\": \"yotia@unprism.ru\", \"full_name\": \"oaf\", \"is_admin\": true}" \
|
||||||
"$ADDR/auth/updateUser"
|
"$ADDR/auth/updateUser"
|
||||||
|
elif [[ $1 == "groups" ]]; then
|
||||||
|
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" "$ADDR/transport/groups"
|
||||||
|
elif [[ $1 == "list-groups" ]]; then
|
||||||
|
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" "$ADDR/transport/listAllGroups"
|
||||||
elif [[ $1 == "users" ]]; then
|
elif [[ $1 == "users" ]]; then
|
||||||
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" "$ADDR/system/getUsers"
|
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" "$ADDR/system/getUsers"
|
||||||
elif [[ $1 == "devices" ]]; then
|
elif [[ $1 == "devices" ]]; then
|
||||||
@@ -79,8 +101,12 @@ elif [[ $1 == "get-from-redis" ]]; then
|
|||||||
"$ADDR/data/getDataFromRedis?fileID=$2"
|
"$ADDR/data/getDataFromRedis?fileID=$2"
|
||||||
elif [[ $1 == "alarms-amount" ]]; then
|
elif [[ $1 == "alarms-amount" ]]; then
|
||||||
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
||||||
-d '{ "devices": ["A56AF66F17D902B8"], "start_time": 1757890398, "end_time": 1757892398 }' \
|
-d '{ "start_time": 1761226492158, "end_time": 1761140092158 }' \
|
||||||
"$ADDR/data/alarms/getAlarmsAmount" | jq
|
"$ADDR/data/alarms/getAlarmsAmount" | jq
|
||||||
|
elif [[ $1 == "alarms-amount-per-device" ]]; then
|
||||||
|
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
||||||
|
-d '{ "start_time": 0, "end_time": 0, "active": false }' \
|
||||||
|
"$ADDR/data/alarms/getGroupAlarmsAmountPerDevice" | jq
|
||||||
elif [[ $1 == "alarms" ]]; then
|
elif [[ $1 == "alarms" ]]; then
|
||||||
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
||||||
-d "{ \"devices\": [\"A56AF66F17D902B8\"], \"start_time\": 1, \"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}" \
|
||||||
@@ -124,7 +150,7 @@ elif [[ $1 == "transport-group-create" ]]; then
|
|||||||
"$ADDR/transport/createGroup" | jq
|
"$ADDR/transport/createGroup" | jq
|
||||||
elif [[ $1 == "sensor-data" ]]; then
|
elif [[ $1 == "sensor-data" ]]; then
|
||||||
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $(cat tmp.token)" \
|
||||||
-d "{ \"device\": \"2025082700003820\", \"sensor\": \"TEMPERATURE/PIIZI_TEMPERATURE_1\", \"start\": $(($(date +%s)-5000)), \"end\": $(date +%s), \"skip\": 1 }" \
|
-d "{ \"device\": \"A56AF66F17D902B8\", \"sensor\": \"TEMPERATURE/85\", \"start\": $(($(date +%s)-5000)), \"end\": $(date +%s), \"skip\": 1 }" \
|
||||||
"$ADDR/data/sensors/getDeviceSensorData" | jq
|
"$ADDR/data/sensors/getDeviceSensorData" | jq
|
||||||
elif [[ $1 == "factory-models" ]]; then
|
elif [[ $1 == "factory-models" ]]; then
|
||||||
if [[ $2 == "" ]]; then
|
if [[ $2 == "" ]]; then
|
||||||
|
|||||||
40
tmp.sh
Executable file
40
tmp.sh
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
# ./req.sh device-params-v2 2025061400000071 > ./tmp/2025061400000071.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000070 > ./tmp/2025072900000070.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000072 > ./tmp/2025072900000072.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000073 > ./tmp/2025072900000073.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000074 > ./tmp/2025072900000074.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000075 > ./tmp/2025072900000075.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000076 > ./tmp/2025072900000076.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000077 > ./tmp/2025072900000077.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000078 > ./tmp/2025072900000078.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000079 > ./tmp/2025072900000079.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000080 > ./tmp/2025072900000080.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000081 > ./tmp/2025072900000081.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000082 > ./tmp/2025072900000082.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000083 > ./tmp/2025072900000083.json
|
||||||
|
# ./req.sh device-params-v2 2025072900000086 > ./tmp/2025072900000086.json
|
||||||
|
|
||||||
|
DIR=./tmp8
|
||||||
|
|
||||||
|
f() {
|
||||||
|
./req.sh device-params-v2 $1 > $DIR/$1.json
|
||||||
|
echo "$1 -- $(cat $DIR/$1.json | jq '.system.reg_number') -- $(cat $DIR/$1.json | jq '.version')"
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir -p $DIR
|
||||||
|
|
||||||
|
f 2025061400000071
|
||||||
|
f 2025072900000070
|
||||||
|
f 2025072900000072
|
||||||
|
f 2025072900000073
|
||||||
|
f 2025072900000074
|
||||||
|
f 2025072900000075
|
||||||
|
f 2025072900000076
|
||||||
|
f 2025072900000077
|
||||||
|
f 2025072900000078
|
||||||
|
f 2025072900000079
|
||||||
|
f 2025072900000080
|
||||||
|
f 2025072900000081
|
||||||
|
f 2025072900000082
|
||||||
|
f 2025072900000083
|
||||||
|
f 2025072900000086
|
||||||
Reference in New Issue
Block a user