You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

46 line
1.1 KiB

  1. #!/bin/bash
  2. BASE_URL="http://localhost:1902" # Change to your port
  3. echo "1. Adding a Gateway..."
  4. curl -X POST "$BASE_URL/reslevis/postGateway" \
  5. -H "Content-Type: application/json" \
  6. -d '{
  7. "id": "gw_01",
  8. "name": "Front Entrance",
  9. "mac": "AA:BB:CC:DD:EE:FF",
  10. "status": "online",
  11. "building": "Main HQ"
  12. }'
  13. sleep 1
  14. echo -e "\n\n2. Listing Gateways..."
  15. curl -X GET "$BASE_URL/reslevis/getGateways"
  16. sleep 1
  17. echo -e "\n\n2. Updating Gateway..."
  18. curl -X PUT "$BASE_URL/reslevis/updateGateway/gw_01" \
  19. -H "Content-Type: application/json" \
  20. -d '{
  21. "id": "gw_01",
  22. "name": "Front Entrance",
  23. "mac": "AA:BB:CC:DD:EE:FF",
  24. "status": "online",
  25. "building": "Pisarna HQ"
  26. }'
  27. sleep 1
  28. echo -e "\n\n2. Listing Gateways..."
  29. curl -X GET "$BASE_URL/reslevis/getGateways"
  30. sleep 1
  31. echo -e "\n\n3. Deleting Gateway..."
  32. curl -X DELETE "$BASE_URL/reslevis/removeGateway/gw_01"
  33. sleep 1
  34. echo -e "\n\n4. Verifying Delete (List again)..."
  35. curl -X GET "$BASE_URL/reslevis/getGateways"