DeviceInstanceController.http 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ## 设备实例管理
  2. ### 分页查询设备实例列表
  3. GET {{host}}/device-instance/_query?pageSize=10
  4. X-Access-Token: {{token}}
  5. Content-Type: application/json
  6. ### 按分类目录查询
  7. GET {{host}}/device-instance/_query?pageSize=10&where=productId$dev-prod-cat=|1|
  8. X-Access-Token: {{token}}
  9. Content-Type: application/json
  10. ### 按标签
  11. GET {{host}}/device-instance/_query?pageSize=10&where=id$dev-tag=a:b,c:a
  12. X-Access-Token: {{token}}
  13. Content-Type: application/json
  14. ### 未激活设备数量查询
  15. GET {{host}}/device-instance/_count?terms%5B0%5D.column=state&terms%5B0%5D.value=notActive
  16. X-Access-Token: {{token}}
  17. Content-Type: application/json
  18. ### 离线设备数量查询
  19. GET {{host}}/device-instance/_count?terms%5B0%5D.column=state&terms%5B0%5D.value=offline
  20. X-Access-Token: {{token}}
  21. Content-Type: application/json
  22. ### 在线设备数量查询
  23. GET {{host}}/device-instance/_count?terms%5B0%5D.column=state&terms%5B0%5D.value=online
  24. X-Access-Token: {{token}}
  25. Content-Type: application/json
  26. ### 设备数量查询
  27. GET {{host}}/device-instance/_count
  28. X-Access-Token: {{token}}
  29. Content-Type: application/json
  30. ### 设备详情查询
  31. GET {{host}}/device/instance/202004110186/detail
  32. X-Access-Token: {{token}}
  33. Content-Type: application/json
  34. ### 修改设备配置
  35. PUT {{host}}/device/instance/202004110186
  36. X-Access-Token: {{token}}
  37. Content-Type: application/json
  38. {"configuration":{"username":"chiefdata","password":"chiefdata"}}
  39. ### 修改/新增设备标签
  40. PATCH {{host}}/device/instance/202004110186/tag
  41. X-Access-Token: {{token}}
  42. Content-Type: application/json
  43. [{"key":"a","value":"a","name":"a","_id":0}]
  44. ### 发布设备配置
  45. POST {{host}}/device-instance/202004110170/deploy
  46. X-Access-Token: {{token}}
  47. Content-Type: application/json
  48. ### 设备日志查询
  49. GET {{host}}/device-instance/202004110170/logs?pageIndex=0&pageSize=10&sorts%5B0%5D.name=createTime&sorts%5B0%5D.order=desc
  50. X-Access-Token: {{token}}
  51. Content-Type: application/json
  52. ### 同步设备状态
  53. GET {{host}}/device/instance/202004110170/state
  54. X-Access-Token: {{token}}
  55. Content-Type: application/json
  56. ### 同步设备属性
  57. GET {{host}}/device/standard/202004110170/property/mistimed
  58. X-Access-Token: {{token}}
  59. Content-Type: application/json
  60. ### 查询设备属性数据历史
  61. GET {{host}}/device-instance/202004110170/properties/_query?pageIndex=0&pageSize=10&sorts%5B0%5D.name=timestamp&sorts%5B0%5D.order=desc&terms%5B0%5D.column=property&terms%5B0%5D.value=voltage
  62. X-Access-Token: {{token}}
  63. Content-Type: application/json
  64. ### 设备注销
  65. POST {{host}}/device-instance/test-6467/undeploy
  66. X-Access-Token: {{token}}
  67. Content-Type: application/json
  68. ### 设备激活
  69. POST {{host}}/device-instance/test-6467/deploy
  70. X-Access-Token: {{token}}
  71. Content-Type: application/json
  72. ### 删除设备
  73. DELETE {{host}}/device-instance/test-6467
  74. X-Access-Token: {{token}}
  75. Content-Type: application/json
  76. ### 删除设备标签
  77. DELETE {{host}}/device/instance/202004110186/tag/1f79ae1b454ad814321088568c041795
  78. X-Access-Token: {{token}}
  79. Content-Type: application/json
  80. ### 断开设备连接
  81. POST {{host}}/device/instance/test-3569/disconnect
  82. X-Access-Token: {{token}}
  83. Content-Type: application/json
  84. ### 新增/修改设备
  85. PATCH {{host}}/device-instance
  86. X-Access-Token: {{token}}
  87. Content-Type: application/json
  88. {
  89. "id":"test-1000000",
  90. "name":"test-1000000",
  91. "productId":"demo-device",
  92. "productName":"演示设备",
  93. "state":{
  94. "text":"未激活",
  95. "value":"notActive"
  96. }
  97. }
  98. ###