A simple Spring Boot project
- Maven
- MySQL
Default database settings are:
- Server: localhost:3306
- Database name: gateways
- Username: root
- Password: root
Default database settings can be changed on file application.properties
-
Recompile and package
mvn clean package
-
Run unit tests
mvn test
-
Deploy on server localhost:8080
mvn spring-boot:run
Gets all gateways.
Parameters:
- No parameters needed
Returns:
- A list of gateway objects
Gets a gateway by serial number.
Parameters:
- serial number: Path parameter. The gateway serial number
Returns:
- The found gateway object, or null
Adds a new gateway
Parameters:
- serialNumber: The gateway serial number
- name: The gateway name
- ipv4: The gateway ip
Returns:
- A result object:
- status: OK or ERROR
- message: The error message, if needed
Removes a gateway by serial number.
Parameteres:
- serial number: Path parameter. The gateway serial number
Returns:
- A result object:
- status: OK or ERROR
- message: The error message, if needed
Adds a new device to a gateway
Parameters:
- serialNumber: The gateway serial number
- uid: The device uid
- vendor: The device vendor
- state: The device state (allowed values: ONLINE | OFFLINE)
Returns:
- A result object:
- status: OK or ERROR
- message: The error message, if needed
Removes a device by uid.
Parameteres:
- uid: Path parameter. The device uid
Returns:
- A result object:
- status: OK or ERROR
- message: The error message, if needed