Skip to content

This sample project is managing gateways - master devices that control multiple peripheral devices.

Notifications You must be signed in to change notification settings

ramniel/gateways

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

REST service (JSON/HTTP) for storing information about gateways and their associated devices.

  • Programming language: Java
  • Framework: Spring Boot
  • Database: In-memory
  • Automated build: Apache Maven

Available Scripts

  • To build open a console and execute ./build.sh
  • To run open a console and execute ./run.sh

Endpoints:

Create a gateway:

POST http://localhost:8080/gateways
body: {
"serial": "string", //a unique serial number ex: AbC123
"name": "string", //a human-readable name ex: Gateway A
"ip": "string" //an IPv4 address ex: 10.0.0.1
}

Delete a gateway:

DELETE http://localhost:8080/gateways/{serial} // ex: http://localhost:8080/gateways/AbC123

Get all stored gateways:

GET http://localhost:8080/gateways

Get a single gateway:

GET http://localhost:8080/gateways/{serial} // ex: http://localhost:8080/gateways/AbC123

Add a device from a gateway

POST http://localhost:8080/gateways/{serial}/device
body: {
"vendor": "string", // ex: Vendor A
"status": "online|offline" // ex: online
}

Remove a device from a gateway

DELETE http://localhost:8080/gateways/{serial}/device/{device_uid} // ex: http://localhost:8080/gateways/AbC123/device/1

About

This sample project is managing gateways - master devices that control multiple peripheral devices.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published