datablue: upload endpoint
- Dominant language
- Go
- Stars
- 1
- Forks
- 3
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 6
Description
Data is currently sent to _DataBlue_ via the `poll` endpoint, which stores data as it is received, using the current wall-clock time of the service (i.e., not a supplied time). Now that clients are able to collect data in **Offline** mode, there needs to be a method to send historical data and to supply the time the data was captured, rather than relying on the service to provide timestamps.
It is proposed to add an `upload` endpoint, implemented as a POST method.
- In additional to the standard device query params, such as `ma` and `dk`, the URL query will specify which pins are present and the amount of data associated with each pin (in bytes).
- The body of the request will contain the data for each pin in query param order, where each datum is represented as a `SmallScalar`.
The `SmallScalar` is an eight-byte struct defined as follows:
```
type SmallScalar struct {
Value int32
Timestamp uint32
}
```
Note that unlike the `Scalar` struct, which is used by the datastore, the `SmallScalar` does not require pin/ID info, since the latter info is supplied via the query param.
For example:
`data.cloudblue.org/upload?A4=65536&X60=65536&X61=65536`
would specify that the request contained 65,536 bytes of A4 (battery voltage), X60 (SST), and X61 (BWT) data respectively.
The total POST payload would therefore be 196,608 bytes (= 65,536 x 3). Furthermore, 65,536 bytes of `SmallScalar` data corresponds to 8,192 data points (65,536 / 8). This represents slightly less than six days worth of data, assuming one sample per minute or 1,440 samples per day.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.