You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Spec details the requirements and interface for the agile-data-api. It's responsible for allowing the user to configure the persistence of data that the agile-api captures as well as an API to query the stored data.
It's intentionally simple, basing the requirements off the agile-data-ui spec.
Requirements:
Ability to set up a service worker(Subscription) for each device + component that runs at user defined interval, queries the agile-api and writes that data to the database.
Ability to query the database by device, by component and/or by time and return records object.
Ability to stream records made by a query and watch for any new records made.
Ability to configure retention policy for database.
Models
We have two models. Subscriptions and Records.
Subscriptions
Subscriptions is a reference to the device + component. A Subscription is a job that is run periodically to write new values to the database.
method: PUT
url: /api/subscription/:device/:component
body: {
interval: '10000'
}
Read subscription for device component
method: GET
url: /api/subscription/:device/:component
Read subscriptions all subscriptions on gateway
method: GET
url: /api/subscription
Read, Update & Delete subscriptions also accept also accepts the use custom queries.
method: GET
url: /api/subscriptions?query='{"where":{"deviceID":"bleA0E6F8B62304"},"limit":"2","sort":"createdAt DESC"}'
Get all records
If the request is made with with ws then a connect is opened an results will be streamed, if the request is standard http then JSON object will be returned.
method: GET
url: /api/records
Get all records with query
method: GET
url: /api/record?query='{"where":{"deviceID":"bleA0E6F8B62304", "componentID": "temperature"},"limit":"500","sort":"lastUpdate DESC"}'
Agile-data-api Spec
This Spec details the requirements and interface for the
agile-data-api
. It's responsible for allowing the user to configure the persistence of data that theagile-api
captures as well as an API to query the stored data.It's intentionally simple, basing the requirements off the agile-data-ui spec.
Requirements:
Ability to set up a service worker(Subscription) for each device + component that runs at user defined interval, queries the agile-api and writes that data to the database.
Ability to query the database by device, by component and/or by time and return records object.
Ability to stream records made by a query and watch for any new records made.
Ability to configure retention policy for database.
Models
We have two models.
Subscriptions
andRecords
.Subscriptions
Subscriptions
is a reference to the device + component. A Subscription is a job that is run periodically to write new values to the database.A Basic representation would look like this:
Subscriptions
have no relation toRecords
.Records
Records
store the data returned from the agile-api.A basic representation:
API
Create subscription for device component
Delete subscription for device component
Update subscription for device component
Read subscription for device component
Read subscriptions all subscriptions on gateway
Read, Update & Delete subscriptions also accept also accepts the use custom queries.
Get all records
If the request is made with with ws then a connect is opened an results will be streamed, if the request is standard http then JSON object will be returned.
Get all records with query
Delete all records matching query
Create new record
Update Retention
Point at which old records are deleted.
Note It maybe possible to make this more granular eg. for add an expiration for each
Record
. But the difficulty depends on implementation details.Create Retention
Point at which old records are deleted.
SDK
We'll also add new
data
methods to the sdk. For instance you could query the data API like so.Let me know if I've missed any functionality that we need for agile-data-ui or any simplifications that could be made.
The text was updated successfully, but these errors were encountered: