linksmart / historical-datastore

Lightweight time-series storage on the Edge of IoT
Apache License 2.0
13 stars 2 forks source link

Improve Datasource representation #12

Closed ghost closed 4 years ago

ghost commented 6 years ago

Datasource v0.5

{
      "id": "9b1921c1-b20f-496a-a127-b5a01f0a91a5",
      "url": "/registry/9b1921c1-b20f-496a-a127-b5a01f0a91a5",
      "data": "/data/9b1921c1-b20f-496a-a127-b5a01f0a91a5",
      "resource": "13/0/49/4/power",
      "meta": {
"name": "Philip's laptop"
      },
      "connector": {
"mqtt": {
  "url": "ssl://demo.linksmart.eu:8883",
  "topic": "LS/v2/ZGW/linksmart-philip/senml",
  "qos": 1
}
      },
      "retention": "1w",
      "aggregation": [
{
  "id": "4efaf6fb",
  "interval": "1m",
  "data": "/aggr/4efaf6fb/9b1921c1-b20f-496a-a127-b5a01f0a91a5",
  "aggregates": [
    "mean"
  ],
  "retention": ""
}
      ],
      "type": "float",
      "format": "application/senml+json"
}

Problems

[LS-447] created by tavakoli

ghost commented 5 years ago

Proposal:

Remove "id" and rename "resource" to "name".

 

How it would change the API:

Registry:

/registry/name/with/slash

/registry/filter/type/path/op/value

Data:

GET /data/name/with/slash

GET /data/encoded_name_1, encoded_name_2

POST /data 

by tavakoli

dschowta commented 4 years ago

The new format is as follows:

     {
      "name": "c5/1/kitchen/coffee-tablet/power",
      "source": {
        "type": "MQTT",
        "url": "tcp://mqtt.eclipse.org:1883",
        "topic": "c5/1/kitchen/coffee-tablet/power"
      },
      "dataType": "float",
      "meta": null,
      "retain": {
         "min":"1w",
         "max":"1y"
      }
dschowta commented 4 years ago

representation is updated from v1.x.x