|
- #!/bin/bash
- BASE_URL="http://localhost:1902" # Change to your port
-
- echo "1. Adding a Gateway..."
- curl -X POST "$BASE_URL/reslevis/postGateway" \
- -H "Content-Type: application/json" \
- -d '{
- "id": "gw_01",
- "name": "Front Entrance",
- "mac": "AA:BB:CC:DD:EE:FF",
- "status": "online",
- "building": "Main HQ"
- }'
-
- sleep 1
-
- echo -e "\n\n2. Listing Gateways..."
- curl -X GET "$BASE_URL/reslevis/getGateways"
-
- sleep 1
-
- echo -e "\n\n2. Updating Gateway..."
- curl -X PUT "$BASE_URL/reslevis/updateGateway/gw_01" \
- -H "Content-Type: application/json" \
- -d '{
- "id": "gw_01",
- "name": "Front Entrance",
- "mac": "AA:BB:CC:DD:EE:FF",
- "status": "online",
- "building": "Pisarna HQ"
- }'
-
- sleep 1
-
- echo -e "\n\n2. Listing Gateways..."
- curl -X GET "$BASE_URL/reslevis/getGateways"
-
- sleep 1
-
- echo -e "\n\n3. Deleting Gateway..."
- curl -X DELETE "$BASE_URL/reslevis/removeGateway/gw_01"
-
- sleep 1
-
- echo -e "\n\n4. Verifying Delete (List again)..."
- curl -X GET "$BASE_URL/reslevis/getGateways"
|