rest.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. {
  2. "about": {
  3. "trial": false,
  4. "author": {
  5. "name": "EMQ",
  6. "email": "contact@emqx.io",
  7. "company": "EMQ Technologies Co., Ltd",
  8. "website": "https://www.emqx.io"
  9. },
  10. "helpUrl": {
  11. "en_US": "https://ekuiper.org/docs/en/latest/guide/sinks/builtin/rest.html",
  12. "zh_CN": "https://ekuiper.org/docs/zh/latest/guide/sinks/builtin/rest.html"
  13. },
  14. "description": {
  15. "en_US": "The action is used for publish output message into a RESTful API.",
  16. "zh_CN": "该动作用于将输出消息发布到 RESTful API 中。"
  17. }
  18. },
  19. "properties": [
  20. {
  21. "name": "url",
  22. "default": "",
  23. "optional": false,
  24. "control": "text",
  25. "type": "string",
  26. "hint": {
  27. "en_US": "The RESTful API endpoint, such as https://www.example.com/api/dummy",
  28. "zh_CN": "RESTful API 终端地址,例如 https://www.example.com/api/dummy"
  29. },
  30. "label": {
  31. "en_US": "URL",
  32. "zh_CN": "地址"
  33. }
  34. },
  35. {
  36. "name": "method",
  37. "optional": true,
  38. "control": "select",
  39. "default": "GET",
  40. "type": "string",
  41. "values": [
  42. "GET",
  43. "POST",
  44. "PUT",
  45. "DELETE",
  46. "HEAD"
  47. ],
  48. "hint": {
  49. "en_US": "The HTTP method for the RESTful API.",
  50. "zh_CN": "RESTful API 的 HTTP 方法。"
  51. },
  52. "label": {
  53. "en_US": "HTTP method",
  54. "zh_CN": "HTTP 方法"
  55. }
  56. },
  57. {
  58. "name": "bodyType",
  59. "optional": true,
  60. "control": "select",
  61. "default": "none",
  62. "type": "string",
  63. "values": [
  64. "none",
  65. "json",
  66. "text",
  67. "html",
  68. "xml",
  69. "javascript",
  70. "form"
  71. ],
  72. "hint": {
  73. "en_US": "The type of the body. For \"get\" and \"head\", no body is required so the default value is \"none\". For other http methods, the default value is \"json\" For \"html\", \"xml\" and \"javascript\", the dataTemplate must be carefully set up to make sure the format is correct.",
  74. "zh_CN": "消息体的类型。对于 \"get\" 和 \"head\",不需要正文,因此默认值为 \"none\"。 对于其他 http 方法,默认值为 \"json\"。对于 \"html\",\"xml\" 和 \"javascript\",必须仔细设置 dataTemplate 以确保格式正确。"
  75. },
  76. "label": {
  77. "en_US": "Body type",
  78. "zh_CN": "消息体类型"
  79. }
  80. },
  81. {
  82. "name": "timeout",
  83. "default": 5000,
  84. "optional": true,
  85. "control": "text",
  86. "type": "int",
  87. "hint": {
  88. "en_US": "The timeout (milliseconds) for a HTTP request, defaults to 5000 ms",
  89. "zh_CN": "HTTP 请求超时的时间(毫秒),默认为5000毫秒"
  90. },
  91. "label": {
  92. "en_US": "Timeout(ms)",
  93. "zh_CN": "超时(ms)"
  94. }
  95. },
  96. {
  97. "name": "headers",
  98. "default": {},
  99. "optional": true,
  100. "control": "list",
  101. "type": "object",
  102. "hint": {
  103. "en_US": "The additional headers to be set for the HTTP request.",
  104. "zh_CN": "要为 HTTP 请求设置的其他标头"
  105. },
  106. "label": {
  107. "en_US": "HTTP headers",
  108. "zh_CN": "HTTP 头"
  109. }
  110. },
  111. {
  112. "name": "certificationPath",
  113. "default": "",
  114. "optional": true,
  115. "connection_related": true,
  116. "control": "text",
  117. "type": "string",
  118. "hint": {
  119. "en_US": "The location of certification path. It can be an absolute path, or a relative path.",
  120. "zh_CN": "证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行 server 命令的路径。"
  121. },
  122. "label": {
  123. "en_US": "Certification path",
  124. "zh_CN": "证书路径"
  125. }
  126. },
  127. {
  128. "name": "privateKeyPath",
  129. "default": "",
  130. "optional": true,
  131. "connection_related": true,
  132. "control": "text",
  133. "type": "string",
  134. "hint": {
  135. "en_US": "The location of private key path. It can be an absolute path, or a relative path. ",
  136. "zh_CN": "私钥路径。可以为绝对路径,也可以为相对路径。"
  137. },
  138. "label": {
  139. "en_US": "Private key path",
  140. "zh_CN": "私钥路径"
  141. }
  142. },
  143. {
  144. "name": "rootCaPath",
  145. "default": "",
  146. "optional": true,
  147. "connection_related": true,
  148. "control": "text",
  149. "type": "string",
  150. "hint": {
  151. "en_US": "The location of root ca path. It can be an absolute path, or a relative path. ",
  152. "zh_CN": "根证书路径,用以验证服务器证书。可以为绝对路径,也可以为相对路径。"
  153. },
  154. "label": {
  155. "en_US": "Root CA path",
  156. "zh_CN": "根证书路径"
  157. }
  158. },
  159. {
  160. "name": "insecureSkipVerify",
  161. "default": true,
  162. "optional": true,
  163. "control": "radio",
  164. "type": "bool",
  165. "hint": {
  166. "en_US": "Control if to skip the certification verification. If it is set to true, then skip certification verification; Otherwise, verify the certification.",
  167. "zh_CN": "控制是否跳过证书认证。如果被设置为 true,那么跳过证书认证;否则进行证书验证。"
  168. },
  169. "label": {
  170. "en_US": "Skip Certification verification",
  171. "zh_CN": "跳过证书验证"
  172. }
  173. },
  174. {
  175. "name": "debugResp",
  176. "default": true,
  177. "optional": true,
  178. "control": "radio",
  179. "type": "bool",
  180. "hint": {
  181. "en_US": "Control if print the response information into the console. If set it to true, then print response; If set to false, then skip print log.",
  182. "zh_CN": "控制是否将响应信息打印到控制台中。 如果将其设置为 true,则打印响应;如果设置为 false,则跳过打印日志。"
  183. },
  184. "label": {
  185. "en_US": "Print HTTP response",
  186. "zh_CN": "打印 HTTP 响应"
  187. }
  188. },
  189. {
  190. "name": "responseType",
  191. "default": "code",
  192. "optional": true,
  193. "control": "select",
  194. "type": "string",
  195. "values": [
  196. "code",
  197. "body"
  198. ],
  199. "hint": {
  200. "en_US": "Response type, could be `code` or `body`. If it is `code`, then eKuiper will check the HTTP response code for response status. If it is `body`, then eKuiper will check the HTTP response body with JSON format and examine the value of the code field.",
  201. "zh_CN": "响应类型,可以是 `code` 或者 `body`,如果是 `code`,那么 eKuiper 会检查 HTTP 响应码来判断响应状态。如果是 `body`,那么 eKuiper 会检查 HTTP 响应正文,要求其为 JSON 格式,并且检查 code 字段的值。"
  202. },
  203. "label": {
  204. "en_US": "Response type",
  205. "zh_CN": "响应类型"
  206. }
  207. },
  208. {
  209. "name": "oauth",
  210. "optional": true,
  211. "control": "list",
  212. "type": "list_object",
  213. "hint": {
  214. "en_US": "Configure the oauth authentication flow.",
  215. "zh_CN": "配置 OAuth 验证流程。"
  216. },
  217. "label": {
  218. "en_US": "OAuth",
  219. "zh_CN": "OAuth"
  220. },
  221. "default":[
  222. {
  223. "name": "access",
  224. "optional": true,
  225. "control": "list",
  226. "type": "list_object",
  227. "hint": {
  228. "en_US": "Configure how to fetch the access token.",
  229. "zh_CN": "配置如何获取访问令牌。"
  230. },
  231. "label": {
  232. "en_US": "Access token request",
  233. "zh_CN": "访问令牌请求"
  234. },
  235. "default": [
  236. {
  237. "name": "url",
  238. "default": "",
  239. "optional": true,
  240. "control": "text",
  241. "type": "string",
  242. "hint": {
  243. "en_US": "The URL where to get the access token.",
  244. "zh_CN": "获取访问令牌的 URL"
  245. },
  246. "label": {
  247. "en_US": "Access Token URL",
  248. "zh_CN": "访问令牌 URL"
  249. }
  250. },
  251. {
  252. "name": "body",
  253. "default": "",
  254. "optional": true,
  255. "control": "textarea",
  256. "type": "string",
  257. "hint": {
  258. "en_US": "The body of access token request",
  259. "zh_CN": "访问令牌请求的正文"
  260. },
  261. "label": {
  262. "en_US": "Access Token Request Body",
  263. "zh_CN": "访问令牌请求的正文"
  264. }
  265. },
  266. {
  267. "name": "expire",
  268. "default": "",
  269. "optional": true,
  270. "control": "text",
  271. "type": "string",
  272. "hint": {
  273. "en_US": "The expire time or expire time template",
  274. "zh_CN": "过期时间"
  275. },
  276. "label": {
  277. "en_US": "Expire Time",
  278. "zh_CN": "过期时间"
  279. }
  280. }
  281. ]
  282. },
  283. {
  284. "name": "refresh",
  285. "optional": true,
  286. "control": "list",
  287. "type": "list_object",
  288. "hint": {
  289. "en_US": "Configure how to refresh token after expiration.",
  290. "zh_CN": "配置令牌过期后如何更新令牌。"
  291. },
  292. "label": {
  293. "en_US": "Refresh token request",
  294. "zh_CN": "更新令牌请求"
  295. },
  296. "default": [
  297. {
  298. "name": "url",
  299. "default": "",
  300. "optional": true,
  301. "control": "text",
  302. "type": "string",
  303. "hint": {
  304. "en_US": "The URL where to get the refresh token.",
  305. "zh_CN": "获取更新令牌的 URL"
  306. },
  307. "label": {
  308. "en_US": "Refresh Token URL",
  309. "zh_CN": "更新令牌 URL"
  310. }
  311. },
  312. {
  313. "name": "headers",
  314. "optional": true,
  315. "control": "list",
  316. "type": "list_object",
  317. "hint": {
  318. "en_US": "The HTTP request headers that you want to send along with the HTTP refresh request.",
  319. "zh_CN": "需要与刷新 Token HTTP 请求一起发送的 HTTP 请求标头。"
  320. },
  321. "label": {
  322. "en_US": "Refresh token request headers",
  323. "zh_CN": "刷新令牌请求标头"
  324. }
  325. },
  326. {
  327. "name": "body",
  328. "default": "",
  329. "optional": true,
  330. "control": "textarea",
  331. "type": "string",
  332. "hint": {
  333. "en_US": "The body of refresh token request",
  334. "zh_CN": "刷新令牌请求的正文"
  335. },
  336. "label": {
  337. "en_US": "Refresh token request body",
  338. "zh_CN": "刷新令牌请求的正文"
  339. }
  340. }
  341. ]
  342. }
  343. ]
  344. }
  345. ],
  346. "node": {
  347. "category": "sink",
  348. "icon": "iconPath",
  349. "label": {
  350. "en": "Rest",
  351. "zh": "Rest"
  352. }
  353. }
  354. }