add http server
This commit is contained in:
26
readme.md
26
readme.md
@ -16,3 +16,29 @@ Plans to add the following databases:
|
||||
TODO, but!
|
||||
|
||||
All dependencies will be covered by docker.
|
||||
|
||||
## Architecture
|
||||
|
||||
This application contains just of two layers:
|
||||
|
||||
- External Layer that accepts http connections
|
||||
- Store Layer that stores entities inside some store hidden by implementation for specific database.
|
||||
|
||||
During to simple logic, there is no need to add additional business-logic layer since its all about
|
||||
saving incoming metrics into database.
|
||||
|
||||
### External Layer
|
||||
|
||||
Typically simple HTTP Server which allows to interact with application by the following handlers:
|
||||
|
||||
| Handler | Request | Parameters | Description |
|
||||
| ------------- | ------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------- |
|
||||
| Upsert metric | POST `/api/v1/stats/{id}` | {id} -- ID of the device. String. JSON-encoded body for stats (see below for model) | Upserts stats for the passed device |
|
||||
| List metrics | GET `/api/v1/stats` | <Not Applicable> | Lists all available metrics |
|
||||
|
||||
### Store Layer
|
||||
|
||||
Provides two methods to interacts with statistics:
|
||||
|
||||
- `List` - list available metrics;
|
||||
- `Upsert` - update metric by device id.
|
||||
|
||||
Reference in New Issue
Block a user