I cloud generate a gadget using following message formats via rest
datasource option in DAS
*response of data retrieve url:*
{ "message" :[
{"is_peak":true,"state":"Florida","metro_area":"Miami","device_id":4,"power_reading":484.4254,"house_id":19},
{"is_peak":false,"state":"Arizona","metro_area":"Phoenix","device_id":1,"power_reading":92.64153,"house_id":13},
{"is_peak":false,"state":"Texas","metro_area":"Dallas","device_id":3,"power_reading":259.73157,"house_id":2}
]}
*response of schema retrieve url:*
{"message":{
"columns":{
"house_id":{"type":"INTEGER","isScoreParam":false,"isIndex":false,
"isFacet" : false},
"metro_area":{"type":"STRING","isScoreParam":false,"isIndex":false,
"isFacet" : false},
"state":{"type":"STRING","isScoreParam":false,"isIndex":false,
"isFacet" : false},
"device_id":{"type":"INTEGER","isScoreParam":false,"isIndex":false,
"isFacet" : false},
"power_reading":{"type":"FLOAT","isScoreParam":false,"isIndex":false,
"isFacet" : false},
"is_peak":{"type":"BOOLEAN","isScoreParam":false,"isIndex":false,
"isFacet" : false}
},
"primaryKeys":[]
}}
On Wed, Sep 7, 2016 at 7:57 PM, Geesara Prathap <[email protected]> wrote:
> Hi Amalka,
>
> If you are to use rest data provider, you need to implement a web
> application which exposes those two APIs. This sample implementation[1-2]
> will help you to understand how these two APIs are implemented. Responses
> of those two APIs should be in the JOSN format as well as response message
> should be similar to this.
>
> Sample response: retrieving the schema.
>
> {
> "columns": {
> "house_id": {
> "type": "INTEGER",
> "isScoreParam": false,
> "isIndex": false
> },
> "metro_area": {
> "type": "STRING",
> "isScoreParam": false,
> "isIndex": false
> },
> "state": {
> "type": "STRING",
> "isScoreParam": false,
> "isIndex": false
> },
> "device_id": {
> "type": "INTEGER",
> "isScoreParam": false,
> "isIndex": false
> },
> "power_reading": {
> "type": "FLOAT",
> "isScoreParam": false,
> "isIndex": false
> },
> "is_peak": {
> "type": "BOOLEAN",
> "isScoreParam": false,
> "isIndex": false
> }
> },
> "primaryKeys": []
> }
>
> Sample response: retrieving the data.
>
> {
>
> "message": [{
> "values": {
> "_version": "1.0.0",
> "is_peak": true,
> "state": "Florida",
> "metro_area": "Miami",
> "device_id": 4,
> "power_reading": 484.4254,
> "house_id": 19
> }
> }, {
> "values": {
> "_version": "1.0.0",
> "is_peak": false,
> "state": "Arizona",
> "metro_area": "Phoenix",
> "device_id": 1,
> "power_reading": 92.64153,
> "house_id": 13
> }
> }]
> }
>
> 1.https://github.com/wso2/product-iots/blob/master/modules/samples/
> geolocationTracker/component/api/src/main/java/org.deviceautomation/
> geolocationTracker/api/GeoLocationTrackerServiceImpl.java#L427
> 2.https://github.com/wso2/product-iots/blob/master/modules/samples/
> geolocationTracker/component/api/src/main/java/org.deviceautomation/
> geolocationTracker/api/GeoLocationTrackerServiceImpl.java#L499
>
> Thanks,
> Geesara
>
> On Wed, Sep 7, 2016 at 1:30 PM, Dunith Dhanushka <[email protected]> wrote:
>
>> +Geesara
>>
>> On Wed, Sep 7, 2016 at 1:24 PM, Amalka Subasinghe <[email protected]>
>> wrote:
>>
>>>
>>> Hi,
>>>
>>> I want to create a gadget in DAS via rest datasource
>>> What are the urls I need to provide for Data Retrieve URL * and Schema
>>> Retrieve URL * ?
>>>
>>> I want execute following kind of queries
>>> curl -GET 'http://wso2.influxdb.com:32086/query?pretty=true'
>>> --data-urlencode "db=k8s" --data-urlencode "q=SHOW MEASUREMENTS"
>>>
>>> Please help
>>>
>>> Thanks
>>> Amalka
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Regards,
>>
>> Dunith Dhanushka,
>> Associate Technical Lead
>> WSO2 Inc,
>>
>> Mobile - +94 71 8615744
>> Blog - *https://medium.com/@dunithd <https://medium.com/@dunithd>*
>> Twitter - @dunithd <http://twitter.com/dunithd>
>>
>
>
>
> --
> Geesara Prathap Kulathunga
> Software Engineer
> WSO2 Inc; http://wso2.com
> Mobile : +940772684174
>
>
--
Amalka Subasinghe
WSO2 Inc.
Mobile: +94 77 9401267
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev