Cloud - GhostBusters-APM/GhostHouse GitHub Wiki
Ghost House Cloud is based on a Kotling + spring + gradle solution.
The project is configured to generate a fat jar. This allows any java machine to run the generated code standalone, without the need of having a java webserver. In order to run this code just type the following (gradle is required), it will launch the server in the 8080 port -Dserver.port=9000 will change it to the 9000.
gradle bootRun
The cloud is also configured with a H2 in memory database, this means when the server is shuted off it will wipe all the session data.
This are the main endpoints it supports
Get "testget" -> Health check endpoint
Get "historic" -> Health check of historic mock data
Get "device" Params userId:String, deviceId:Long (not required) -> will retrive an array of devices of the user, if a deviceId is specified it will send just this device
Post "device" Body {"userId":String,"name":String,"latitude":String,"longitude":String,"type":int,"state":Boolean,"ip":String} -> creates a new device with the provided data
Post "devicePower" {deviceId:String,kwt:Double,from:Date,to:Date} -> registers a decive consumption
Get "devicePower" {userId:String,deviceId:Long} -> gets the power consumption of a device