接口管理

线上可视化接口

管理接口

站点:

curl -X GET http://47.95.254.34:5122/iot/api/sites


curl -X GEThttp://47.95.254.34:5122/iot/api/sites/7b0db932-43c2-11e8-a7b2-705ab6ad9cae


curl -X POST http://47.95.254.34:5122/iot/api/sites -d

'{"token":"","name":"test","description":"testsite","metadata" : { } }'


curl -X DELET http://47.95.254.34:5122/iot/api/sites/9f55bdc8-430c-11e8-a46b-00231487c7b4


curl -X PUT http://47.95.254.34:5122/iot/api/sites -d

'{"token":"7b0db932-43c2-11e8-a7b2-705ab6ad9cae","name":"test","description":"testsite","metadata" : {"type":"test"}}'


租户:

curl -X GET http://47.95.254.34:5122/iot/api/tenants


curl -X GET http://47.95.254.34:5122/iot/api/tenants/test1


curl -X POST http://47.95.254.34:5122/iot/api/tenants -d

'{"id":"test","name":"testtenant","authenticationToken":"","authorizedUserIds":["admin"],"metadata": {}}'


curl -X DELET http://47.95.254.34:5122/iot/api/tenants


curl -X PUT http://47.95.254.34:5122/iot/api/tenants -d

'{"id":"test","name":"testtenant","authenticationToken":"123","authorizedUserIds":["admin"],"metadata": {}}'

用户:

curl -X GET http://47.95.254.34:5122/iot/api/users


curl -X GET http://47.95.254.34:5122/iot/api/users/atm


curl -X POST http://47.95.254.34:5122/iot/api/users -d

'{"username":"atm","hashedPassword":"123456","metadata":{}}'


curl -X DELET http://47.95.254.34:5122/iot/api/users/atm006


curl -X PUT http://47.95.254.34:5122/iot/api/users -d

'{"username":"atm","hashedPassword":"1234561","metadata":{}}'


设备:


curl -X GET http://47.95.254.34:5122/iot/api/devices/test1234560


curl -X GET http://127.0.0.1:5000/iot/spi/devices?type=0001


curl -X POST http://47.95.254.34:5122/iot/api/devices -d

'{"hardwareId":"test123456","siteToken":"","comments":"","metadata":{}}'


curl -X DELET http://47.95.254.34:5122/iot/api/devices/test1234560


curl -X PUT http://47.95.254.34:5122/iot/api/devices -d

'{"hardwareId":"test123456","siteToken":"1234","comments":"","metadata":{}}'



事件接口


设备数据:

curl -X GET http:// 127.0.0.1:5120/iot/ spi/devices/ test1234560z/events/ DevicesData


用户命令:


curl -X GET http://127.0.0.1:5120/iot/spi/devices/test1234560z/events/ UserCommands


 curl -X POST http://127.0.0.1:5120/iot/spi/devices/test1234560z/events/UserCommands -d 

'{"eventType":"test","siteToken":"testtoken","hardwareId":"test1234560z","metadata":{},"eventbody":{},"ext":{"test":"test"}}'

MQTT接口


接入Topic:/iot/input/json

json消息:

{"eventType":"DevicesData","siteToken":"testtoken","eventDate":"xx","receivedDate":"xx","hardwareId":"test1234560z","metadata":{"xyx":"zzz"},"eventbody":[]}


订阅Topic:

    1、/iot/output/json

    2、/iot/output/json/<sitetoken> #待续


线上可视化接口

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值