|
- #!/bin/bash
- BASE_URL="http://localhost:1902" # Change to your port
-
- echo "1. Adding a Tracker..."
- curl -X POST "$BASE_URL/reslevis/postTracker" \
- -H "Content-Type: application/json" \
- -d '{
- "id": "tracker_01",
- "name": "Employee Badge #001",
- "mac": "11:22:33:44:55:66",
- "status": "active",
- "model": "BLE Beacon v2",
- "position": "Office A-101",
- "notes": "Primary employee tracker",
- "x": 150,
- "y": 200,
- "floor": "550e8400-e29b-41d4-a716-446655440000",
- "building": "550e8400-e29b-41d4-a716-446655440001"
- }'
-
- sleep 1
-
- echo -e "\n\n2. Listing Trackers..."
- curl -X GET "$BASE_URL/reslevis/getTrackers"
-
- sleep 1
-
- echo -e "\n\n3. Updating Tracker..."
- curl -X PUT "$BASE_URL/reslevis/updateTracker" \
- -H "Content-Type: application/json" \
- -d '{
- "id": "tracker_01",
- "name": "Employee Badge #001 - Updated",
- "mac": "11:22:33:44:55:66",
- "status": "inactive",
- "model": "BLE Beacon v2",
- "position": "Office B-205",
- "notes": "Updated position and status",
- "x": 300,
- "y": 400,
- "floor": "550e8400-e29b-41d4-a716-446655440002",
- "building": "550e8400-e29b-41d4-a716-446655440001"
- }'
-
- sleep 1
-
- echo -e "\n\n4. Listing Trackers after update..."
- curl -X GET "$BASE_URL/reslevis/getTrackers"
-
- sleep 1
-
- echo -e "\n\n5. Deleting Tracker..."
- curl -X DELETE "$BASE_URL/reslevis/removeTracker/tracker_01"
-
- sleep 1
-
- echo -e "\n\n6. Verifying Delete (List again)..."
- curl -X GET "$BASE_URL/reslevis/getTrackers"
|