dc3-gateway.http 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. #
  2. # Copyright 2016-present the original author or authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # https://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. ### --------------------- Gateway User Api ---------------------
  17. ### 注册用户
  18. #/api/v3/register
  19. POST http://{{dc3-gateway}}/api/v3/register
  20. Accept: */*
  21. Content-Type: application/json
  22. Cache-Control: no-cache
  23. {
  24. "name": "dc3",
  25. "password": "dc3dc3dc3",
  26. "description": "平台开发者账号"
  27. }
  28. ### --------------------- Gateway Token Api---------------------
  29. ### 生成用户 Salt
  30. #/api/v3/token/salt
  31. GET http://{{dc3-gateway}}/api/v3/token/salt
  32. Accept: */*
  33. Content-Type: application/json
  34. Cache-Control: no-cache
  35. {
  36. "name": "pnoker"
  37. }
  38. ### 生成用户 Token 令牌
  39. #/api/v3/token/generate
  40. POST http://{{dc3-gateway}}/api/v3/token/generate
  41. Accept: */*
  42. Content-Type: application/json
  43. Cache-Control: no-cache
  44. {
  45. "name": "pnoker",
  46. "password": "900eb6ba49ffd909b74b71da2a395824"
  47. }
  48. ### 检测用户 Token 令牌是否有效
  49. #/api/v3/token/check
  50. GET http://{{dc3-gateway}}/api/v3/token/check
  51. Accept: */*
  52. Content-Type: application/x-www-form-urlencoded
  53. Cache-Control: no-cache
  54. username=pnoker&token=eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJwbm9rZXIiLCJpYXQiOjE1OTIwNTgyMTEsImV4cCI6MTU5MjA3OTgxMX0.nJ2fmItykFVqaRIbjIeqNVc4vDAOP5lPyNZtfcfNzgg
  55. ### 注销用户 Token 令牌
  56. #/api/v3/token/cancel
  57. GET http://{{dc3-gateway}}/api/v3/token/cancel
  58. Accept: */*
  59. Content-Type: application/x-www-form-urlencoded
  60. Cache-Control: no-cache
  61. username=pnoker
  62. ### --------------------- Gateway Driver Api---------------------
  63. ### 新增 Driver
  64. #/manager/driver/add
  65. POST http://{{dc3-gateway}}/api/v3/manager/driver/add
  66. Accept: */*
  67. Content-Type: application/json
  68. Cache-Control: no-cache
  69. {
  70. "name": "测试驱动",
  71. "serviceName": "dc3-driver-test",
  72. "host": "127.0.0.1",
  73. "port": 8799,
  74. "description": "测试驱动"
  75. }
  76. ### 批量新增 Driver
  77. #/manager/driver/batch_import
  78. POST http://{{dc3-gateway}}/api/v3/manager/driver/batch_import
  79. Accept: */*
  80. Content-Type: application/json
  81. Cache-Control: no-cache
  82. < ../../files/batch-import.json
  83. ### 修改 Driver
  84. #/api/v3/manager/driver/update
  85. POST http://{{dc3-gateway}}/api/v3/manager/driver/update
  86. Accept: */*
  87. Content-Type: application/json
  88. Cache-Control: no-cache
  89. {
  90. "id": 1,
  91. "name": "测试驱动",
  92. "serviceName": "dc3-driver-test",
  93. "host": "127.0.0.1",
  94. "port": 8799,
  95. "description": "测试驱动"
  96. }
  97. ### 根据 ID 查询 Driver
  98. #/api/v3/manager/driver/id/:id
  99. GET http://{{dc3-gateway}}/api/v3/manager/driver/id/1
  100. Accept: */*
  101. Cache-Control: no-cache
  102. ### 查询 Driver 服务状态
  103. #/api/v3/manager/driver/driverStatus,支持name\serverName\host模糊查询,port精准查询
  104. POST http://{{dc3-gateway}}/api/v3/manager/driver/driverStatus
  105. Accept: */*
  106. Content-Type: application/json
  107. Cache-Control: no-cache
  108. {
  109. "name": "",
  110. "page": {
  111. "current": 1,
  112. "orders": [
  113. {
  114. "column": "id",
  115. "asc": false
  116. }
  117. ]
  118. }
  119. }
  120. ### 分页查询 Driver
  121. #/api/v3/manager/driver/list,支持name\serverName\host模糊查询,port精准查询
  122. POST http://{{dc3-gateway}}/api/v3/manager/driver/list
  123. Accept: */*
  124. Content-Type: application/json
  125. Cache-Control: no-cache
  126. {
  127. "name": "",
  128. "page": {
  129. "current": 1,
  130. "orders": [
  131. {
  132. "column": "id",
  133. "asc": false
  134. }
  135. ]
  136. }
  137. }
  138. ### 根据 ID 删除 Driver
  139. #/api/v3/manager/driver/delete/:id
  140. POST http://{{dc3-gateway}}/api/v3/manager/driver/delete/1
  141. Accept: */*
  142. Content-Type: application/json
  143. Cache-Control: no-cache
  144. ### --------------------- Gateway Driver Attribute ---------------------
  145. ### 新增 DriverAttribute
  146. #/api/v3/manager/driver_attribute/add
  147. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute/add
  148. Accept: */*
  149. Content-Type: application/json
  150. Cache-Control: no-cache
  151. {
  152. "displayName": "测试IP",
  153. "name": "ip",
  154. "type": "string",
  155. "value": "localhost",
  156. "driverId": -1,
  157. "description": "测试驱动属性"
  158. }
  159. ### 修改 DriverAttribute
  160. #/api/v3/manager/driver_attribute/update
  161. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute/update
  162. Accept: */*
  163. Content-Type: application/json
  164. Cache-Control: no-cache
  165. {
  166. "id": 1,
  167. "displayName": "测试IP",
  168. "name": "ip",
  169. "type": "string",
  170. "value": "localhost",
  171. "driverId": -1,
  172. "description": "测试驱动属性"
  173. }
  174. ### 根据 ID 查询 DriverAttribute
  175. #/api/v3/manager/driver_attribute/id/:id
  176. GET http://{{dc3-gateway}}/api/v3/manager/driver_attribute/id/1
  177. Accept: */*
  178. Cache-Control: no-cache
  179. ### 分页查询 DriverAttribute
  180. #/api/v3/manager/driver_attribute/list,支持displayName模糊查询,name\type\driverId精准查询
  181. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute/list
  182. Accept: */*
  183. Content-Type: application/json
  184. Cache-Control: no-cache
  185. {
  186. "displayName": "",
  187. "page": {
  188. "current": 1,
  189. "orders": [
  190. {
  191. "column": "id",
  192. "asc": false
  193. }
  194. ]
  195. }
  196. }
  197. ### 根据 ID 删除 DriverAttribute
  198. #/api/v3/manager/driver_attribute/delete/:id
  199. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute/delete/1
  200. Accept: */*
  201. Content-Type: application/json
  202. Cache-Control: no-cache
  203. ### --------------------- Gateway Driver Attribute Config ---------------------
  204. ### 新增 DriverInfo
  205. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute_config/add
  206. Accept: */*
  207. Content-Type: application/json
  208. Cache-Control: no-cache
  209. {
  210. "driverAttributeId": 1,
  211. "value": "localhost",
  212. "profileId": -1,
  213. "description": "测试驱动配置"
  214. }
  215. ### 修改 DriverInfo
  216. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute_config/update
  217. Accept: */*
  218. Content-Type: application/json
  219. Cache-Control: no-cache
  220. {
  221. "id": 1,
  222. "driverAttributeId": 1,
  223. "value": "localhost",
  224. "profileId": -1,
  225. "description": "测试驱动配置"
  226. }
  227. ### 根据 ID 查询 DriverInfo
  228. GET http://{{dc3-gateway}}/api/v3/manager/driver_attribute_config/id/1
  229. Accept: */*
  230. Cache-Control: no-cache
  231. ### 分页查询 DriverInfo
  232. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute_config/list
  233. Accept: */*
  234. Content-Type: application/json
  235. Cache-Control: no-cache
  236. {
  237. "page": {
  238. "current": 1,
  239. "orders": [
  240. {
  241. "column": "id",
  242. "asc": false
  243. }
  244. ]
  245. }
  246. }
  247. ### 根据 ID 删除 DriverInfo
  248. POST http://{{dc3-gateway}}/api/v3/manager/driver_attribute_config/delete/1
  249. Accept: */*
  250. Content-Type: application/json
  251. Cache-Control: no-cache
  252. ###