Browse Source

feat: add internal sink plugins

RockyJin 4 years atrás
parent
commit
cde2870f2e

+ 1 - 1
docs/en_US/rules/sinks/edgex.md

@@ -4,7 +4,7 @@ The action is used for publish output message into EdgeX message bus.
 
 | Property name | Optional | Description                                                  |
 | ------------- | -------- | ------------------------------------------------------------ |
-| protocol      | true     | If it's not specified, then use default value ``tcp``.       |
+| protocol      | true     | The protocol. If it's not specified, then use default value ``tcp``. |
 | host          | true     | The host of message bus. If not specified, then use default value ``*``. |
 | port          | true     | The port of message bus. If not specified, then use default value ``5563``. |
 | topic         | true     | The topic to be published. If not specified, then use default value ``events``. |

+ 1 - 1
docs/en_US/rules/sinks/logs.md

@@ -1,6 +1,6 @@
 # Log action
 
-The action is used for print output message into log file, the log file is at  `` $kuiper_install/log/stream.log`` by default.
+The action is used for print output message into log file, the log file is at `$kuiper_install/log/stream.log` by default.
 
 No properties can be specified for the action.
 

+ 11 - 11
docs/en_US/rules/sinks/mqtt.md

@@ -1,20 +1,20 @@
 # MQTT action
 
-The action is used for publish output message into a MQTT server. 
+The action is used for publish output message into an MQTT server. 
 
 | Property name      | Optional | Description                                                  |
 | ------------------ | -------- | ------------------------------------------------------------ |
-| server             | false    | The broker address of the mqtt server, such as ``tcp://127.0.0.1:1883`` |
-| topic              | false    | The mqtt topic, such as ``analysis/result``                  |
-| clientId           | true     | The client id for mqtt connection. If not specified, an uuid will be used |
-| protocolVersion    | true     | 3.1 (also refer as MQTT 3) or 3.1.1 (also refer as MQTT 4).  If not specified, the default value is 3.1. |
-| qos                | true     | The QoS for message delivery. Only int type value 0 or 1 or 2.                                |
-| username           | true     | The user name for the connection.                            |
+| server             | false    | The broker address of the MQTT server, such as `tcp://127.0.0.1:1883` |
+| topic              | false    | The MQTT topic, such as `analysis/result`                    |
+| clientId           | true     | The client id for MQTT connection. If not specified, an uuid will be used |
+| protocolVersion    | true     | MQTT protocol version. 3.1 (also refer as MQTT 3) or 3.1.1 (also refer as MQTT 4).  If not specified, the default value is 3.1. |
+| qos                | true     | The QoS for message delivery. Only int type value 0 or 1 or 2. |
+| username           | true     | The username for the connection.                             |
 | password           | true     | The password for the connection.                             |
-| certificationPath  | true     | The certification path. It can be an absolute path, or a relative path. If it is an relative path, then the base path is where you excuting the ``server`` command. For example, if you run ``bin/server`` from ``/var/kuiper``, then the base path is ``/var/kuiper``; If you run ``./server`` from ``/var/kuiper/bin``, then the base path is ``/var/kuiper/bin``. |
-| privateKeyPath     | true     | The private key path. It can be either absolute path, or relative path. For more detailed information, please refer to ``certificationPath``. |
-| insecureSkipVerify | true     | If InsecureSkipVerify is ``true``, TLS accepts any certificate presented by the server and any host name in that certificate.  In this mode, TLS is susceptible to man-in-the-middle attacks. The default value is ``false``. The configuration item can only be used with TLS connections. |
-| retained           | true     | If retained is ``true``,The broker stores the last retained message and the corresponding QoS for that topic.The default value is ``false``.
+| certificationPath  | true     | The certification path. It can be an absolute path, or a relative path. If it is an relative path, then the base path is where you excuting the `server` command. For example, if you run `bin/server` from `/var/kuiper`, then the base path is `/var/kuiper`; If you run `./server` from `/var/kuiper/bin`, then the base path is `/var/kuiper/bin`. |
+| privateKeyPath     | true     | The private key path. It can be either absolute path, or relative path, which is similar to use of certificationPath. |
+| insecureSkipVerify | true     | If InsecureSkipVerify is `true`, TLS accepts any certificate presented by the server and any host name in that certificate.  In this mode, TLS is susceptible to man-in-the-middle attacks. The default value is `false`. The configuration item can only be used with TLS connections. |
+| retained           | true     | If retained is `true`,The broker stores the last retained message and the corresponding QoS for that topic.The default value is `false`.
 
 Below is sample configuration for connecting to Azure IoT Hub by using SAS authentication.
 ```json

+ 2 - 2
docs/en_US/rules/sinks/nop.md

@@ -1,9 +1,9 @@
 # Nop action
 
-The action is an Nop sink, the result sent to this sink will be ignored. If specify the ``log`` property to ``true``, then the result will be saved into log file, the log file is at  `` $kuiper_install/log/stream.log`` by default.
+The action is an Nop sink, the result sent to this sink will be ignored. If specify the `log` property to `true`, then the result will be saved into log file, the log file is at `$kuiper_install/log/stream.log` by default.
 
 | Property name      | Optional | Description                                                  |
 | ------------------ | -------- | ------------------------------------------------------------ |
-| log             | true | true/false - print the sink result to log or not. By default is ``false``, that will not print the result to log file. |
+| log             | true | true/false - print the sink result to log or not. By default is `false`, that will not print the result to log file. |
 
 

File diff suppressed because it is too large
+ 5 - 5
docs/en_US/rules/sinks/rest.md


+ 2 - 2
docs/zh_CN/rules/sinks/edgex.md

@@ -4,8 +4,8 @@
 
 | 名称        | 可选 | Description                                                  |
 | ----------- | -------- | ------------------------------------------------------------ |
-| protocol    | true     | 如未指定,使用缺省值 `tcp`.                                |
-| host        | 是    | 消息总线目标主机地址,使用缺省值 `*`.                      |
+| protocol    | true     | 协议,如未指定,使用缺省值 `tcp`.                             |
+| host        | 是    | 消息总线主机地址,使用缺省值 `*`.                      |
 | port        | 是    | 消息总线端口号。 如未指定,使用缺省值 `5563`.              |
 | topic       | 是    | 发布的主题名称,如未指定,使用缺省值 `events`.             |
 | contentType | 是    | 发布消息的内容类型,如未指定,使用缺省值 `application/json`. |

+ 50 - 50
docs/zh_CN/rules/sinks/mqtt.md

@@ -1,50 +1,50 @@
-# MQTT动作
-
-该操作用于将输出消息发布到 MQTT 服务器中。
-
-| 属性名称 | 是否可选 | 说明                                          |
-| ------------- | -------- | ---------------------------------------------------- |
-| server        | 否    | mqtt  服务器的代理地址,例如 `tcp://127.0.0.1:1883` |
-| topic          | 否    | mqtt 主题,例如``分析/结果``                         |
-| clientId      | 是     | mqtt 连接的客户端 ID。 如果未指定,将使用一个 uuid   |
-| protocolVersion   | 是    | 3.1 (也被称为 MQTT 3) 或者 3.1.1 (也被称为 MQTT 4)。 如果未指定,缺省值为 3.1。|
-| qos               | 是    | 消息转发的服务质量                               |
-| username          | 是    | 连接用户名                            |
-| password          | 是    | 连接密码                             |
-| certificationPath | 是    | 证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行 `server` 命令的路径。比如,如果你在 `/var/kuiper` 中运行 `bin/server` ,那么父目录为 `/var/kuiper`; 如果运行从 `/var/kuiper/bin` 中运行`./server`,那么父目录为 `/var/kuiper/bin`。 |
-| privateKeyPath    | 是    | 私钥路径。可以为绝对路径,也可以为相对路径。更详细的信息,请参考 `certificationPath`. |
-| insecureSkipVerify | true     | 如果 InsecureSkipVerify 设置为 ``true``, TLS接受服务器提供的任何证书以及该证书中的任何主机名。 在这种模式下,TLS容易受到中间人攻击。默认值为``false``。配置项只能用于TLS连接。|
-| retained           | true     | 如果 retained 设置为 ``true``,Broker会存储每个Topic的最后一条保留消息及其Qos。默认值是``false``   
-
-以下为使用 SAS 连接到 Azure IoT Hub 的样例。
-```json
-    {
-      "mqtt": {
-        "server": "ssl://xyz.azure-devices.net:8883",
-        "topic": "devices/demo_001/messages/events/",
-        "protocolVersion": "3.1.1",
-        "qos": 1,
-        "clientId": "demo_001",
-        "username": "xyz.azure-devices.net/demo_001/?api-version=2018-06-30",
-        "password": "SharedAccessSignature sr=*******************",
-        "retained": false
-      }
-    }
-```
-
-以下为使用证书和私钥连接到 AWS IoT的另一个样例。
-
-```json
-    {
-      "mqtt": {
-        "server": "ssl://xyz-ats.iot.us-east-1.amazonaws.com:8883",
-        "topic": "devices/result",
-        "qos": 1,
-        "clientId": "demo_001",
-        "certificationPath": "keys/d3807d9fa5-certificate.pem",
-        "privateKeyPath": "keys/d3807d9fa5-private.pem.key",
-        "retained": false
-      }
-    }
-```
-
+# MQTT动作
+
+该操作用于将输出消息发布到 MQTT 服务器中。
+
+| 属性名称 | 是否可选 | 说明                                          |
+| ------------- | -------- | ---------------------------------------------------- |
+| server        | 否    | MQTT  服务器地址,例如 `tcp://127.0.0.1:1883` |
+| topic          | 否    | MQTT 主题,例如 `analysis/result`                     |
+| clientId      | 是     | MQTT 连接的客户端 ID。 如果未指定,将使用一个 uuid |
+| protocolVersion   | 是    | MQTT 协议版本。3.1 (也被称为 MQTT 3) 或者 3.1.1 (也被称为 MQTT 4)。 如果未指定,缺省值为 3.1。 |
+| qos               | 是    | 消息转发的服务质量                               |
+| username          | 是    | 连接用户名                            |
+| password          | 是    | 连接密码                             |
+| certificationPath | 是    | 证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行 `server` 命令的路径。比如,如果你在 `/var/kuiper` 中运行 `bin/server` ,那么父目录为 `/var/kuiper`; 如果运行从 `/var/kuiper/bin` 中运行`./server`,那么父目录为 `/var/kuiper/bin`。 |
+| privateKeyPath    | 是    | 私钥路径。可以为绝对路径,也可以为相对路径,相对路径的用法与 `certificationPath` 类似。 |
+| insecureSkipVerify | true     | 如果 InsecureSkipVerify 设置为 `true`, TLS接受服务器提供的任何证书以及该证书中的任何主机名。 在这种模式下,TLS容易受到中间人攻击。默认值为`false`。配置项只能用于TLS连接。|
+| retained           | true     | 如果 retained 设置为 `true`,Broker会存储每个Topic的最后一条保留消息及其Qos。默认值是 `false`   
+
+以下为使用 SAS 连接到 Azure IoT Hub 的样例。
+```json
+    {
+      "mqtt": {
+        "server": "ssl://xyz.azure-devices.net:8883",
+        "topic": "devices/demo_001/messages/events/",
+        "protocolVersion": "3.1.1",
+        "qos": 1,
+        "clientId": "demo_001",
+        "username": "xyz.azure-devices.net/demo_001/?api-version=2018-06-30",
+        "password": "SharedAccessSignature sr=*******************",
+        "retained": false
+      }
+    }
+```
+
+以下为使用证书和私钥连接到 AWS IoT的另一个样例。
+
+```json
+    {
+      "mqtt": {
+        "server": "ssl://xyz-ats.iot.us-east-1.amazonaws.com:8883",
+        "topic": "devices/result",
+        "qos": 1,
+        "clientId": "demo_001",
+        "certificationPath": "keys/d3807d9fa5-certificate.pem",
+        "privateKeyPath": "keys/d3807d9fa5-private.pem.key",
+        "retained": false
+      }
+    }
+```
+

+ 1 - 1
docs/zh_CN/rules/sinks/nop.md

@@ -1,6 +1,6 @@
 # Nop action
 
-该 action 是一个空操作目标,所有发送到此的结果将被忽略。如果指定 ``log`` 属性为 `true`,那么结果将会保存到日志文件,日志文件缺省保存在  `$kuiper_install/log/stream.log`。
+该 action 是一个空操作目标,所有发送到此的结果将被忽略。如果指定 `log` 属性为 `true`,那么结果将会保存到日志文件,日志文件缺省保存在  `$kuiper_install/log/stream.log`。
 
 | 属性名称  | 是否可选 | 说明                                                  |
 | ------------------ | -------- | ------------------------------------------------------------ |

File diff suppressed because it is too large
+ 6 - 5
docs/zh_CN/rules/sinks/rest.md


plugins/sinks/file.json → etc/sinks/file.json


plugins/sinks/influxdb.json → etc/sinks/influxdb.json


+ 328 - 0
etc/sinks/internal/edgex.json

@@ -0,0 +1,328 @@
+{
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "EMQ",
+      "email": "contact@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/rules/sinks/mqtt.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/rules/sinks/mqtt.md"
+    },
+    "description": {
+      "en_US": "The action is used for publish output message into an MQTT server.",
+      "zh_CN": "该操作用于将输出消息发布到 MQTT 服务器中"
+    }
+  },
+  "properties": [
+    {
+      "name": "protocol",
+      "default": "tcp",
+      "optional": true,
+      "control": "select",
+      "values": [
+        "tcp"
+      ],
+      "type": "list_string",
+      "hint": {
+        "en_US": "The protocol. If it's not specified, then use default value 'tcp'.",
+        "zh_CN": "协议,如未指定,使用缺省值 tcp。"
+      },
+      "label": {
+        "en_US": "Protocol",
+        "zh_CN": "协议"
+      }
+    },
+    {
+      "name": "host",
+      "optional": true,
+      "control": "text",
+      "default": "*",
+      "type": "string",
+      "hint": {
+        "en_US": "The host of message bus. If not specified, then use default value '*'",
+        "zh_CN": "消息总线主机地址,使用缺省值 *."
+      },
+      "label": {
+        "en_US": "Binding host",
+        "zh_CN": "绑定主机"
+      }
+    },
+    {
+      "name": "port",
+      "optional": true,
+      "control": "text",
+      "default": 5563,
+      "type": "int",
+      "hint": {
+        "en_US": "The port of message bus",
+        "zh_CN": "消息总线端口号"
+      },
+      "label": {
+        "en_US": "Port",
+        "zh_CN": "端口"
+      }
+    },
+    {
+      "name": "topic",
+      "default": "events",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The topic to be published. If not specified, then use default value 'events'.",
+        "zh_CN": "发布的主题名称,如未指定,使用缺省值 events."
+      },
+      "label": {
+        "en_US": "Topic",
+        "zh_CN": "主题"
+      }
+    },
+    {
+      "name": "contentType",
+      "default": "application/json",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The content type of message to be published. If not specified, then use the default value 'application/json'.",
+        "zh_CN": "发布消息的内容类型,如未指定,则使用缺省值 application/json."
+      },
+      "label": {
+        "en_US": "Content type",
+        "zh_CN": "内容类型"
+      }
+    },
+    {
+      "name": "metadata",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The property is a field name that allows user to specify a field name of SQL  select clause,  the field name should use meta(*) AS xxx  to select all of EdgeX metadata from message.",
+        "zh_CN": "该属性为一个字段名称,该字段是 SQL SELECT 子句的一个字段名称,这个字段应该类似于 meta(*) AS xxx ,用于选出消息中所有的 EdgeX 元数据."
+      },
+      "label": {
+        "en_US": "Metadata field name",
+        "zh_CN": "元数据字段名"
+      }
+    },
+    {
+      "name": "deviceName",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "Allows user to specify the device name in the event structure that are sent from Kuiper.",
+        "zh_CN": "允许用户指定设备名称,该名称将作为从 Kuiper 中发送出来的 Event 结构体的设备名称"
+      },
+      "label": {
+        "en_US": "Device name",
+        "zh_CN": "设备名称"
+      }
+    },
+    {
+      "name": "type",
+      "default": "zero",
+      "optional": true,
+      "control": "select",
+      "values": [
+        "mqtt",
+        "zero"
+      ],
+      "type": "string_list",
+      "hint": {
+        "en_US": "The message bus type, two types of message buses are supported, 'zero' or 'mqtt', and 'zero' is the default value.",
+        "zh_CN": "消息总线类型,目前支持两种类型的消息总线,'zero' 或者 'mqtt',其中 'zero' 为缺省类型。"
+      },
+      "label": {
+        "en_US": "Message bus type",
+        "zh_CN": "消息总线类型"
+      }
+    },
+    {
+      "name": "optional.ClientId",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT clientID",
+        "zh_CN": "MQTT 客户端 ID"
+      },
+      "label": {
+        "en_US": "MQTT clientID",
+        "zh_CN": "MQTT 客户端 ID"
+      }
+    },
+    {
+      "name": "optional.Username",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT username",
+        "zh_CN": "MQTT 用户名"
+      },
+      "label": {
+        "en_US": "MQTT username",
+        "zh_CN": "MQTT 用户名"
+      }
+    },
+    {
+      "name": "optional.Password",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT password",
+        "zh_CN": "MQTT 密码"
+      },
+      "label": {
+        "en_US": "MQTT password",
+        "zh_CN": "MQTT 密码"
+      }
+    },
+    {
+      "name": "optional.Qos",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT QoS",
+        "zh_CN": "MQTT 服务质量"
+      },
+      "label": {
+        "en_US": "MQTT QoS",
+        "zh_CN": "MQTT 服务质量"
+      }
+    },
+    {
+      "name": "optional.KeepAlive",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT keepalive",
+        "zh_CN": "MQTT keepalive"
+      },
+      "label": {
+        "en_US": "MQTT keepalive",
+        "zh_CN": "MQTT keepalive"
+      }
+    },
+    {
+      "name": "optional.Retained",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT retained",
+        "zh_CN": "MQTT retained"
+      },
+      "label": {
+        "en_US": "MQTT retained",
+        "zh_CN": "MQTT retained"
+      }
+    },
+    {
+      "name": "optional.ConnectionPayload",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT connection payload",
+        "zh_CN": "MQTT connection payload"
+      },
+      "label": {
+        "en_US": "MQTT connection payload",
+        "zh_CN": "MQTT connection payload"
+      }
+    },
+    {
+      "name": "optional.CertFile",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT cert file",
+        "zh_CN": "MQTT cert file"
+      },
+      "label": {
+        "en_US": "MQTT cert file",
+        "zh_CN": "MQTT cert file"
+      }
+    },
+    {
+      "name": "optional.KeyFile",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT key file",
+        "zh_CN": "MQTT key file"
+      },
+      "label": {
+        "en_US": "MQTT key file",
+        "zh_CN": "MQTT key file"
+      }
+    },
+    {
+      "name": "optional.CertPEMBlock",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT cert PEM block",
+        "zh_CN": "MQTT cert PEM block"
+      },
+      "label": {
+        "en_US": "MQTT cert PEM block",
+        "zh_CN": "MQTT cert PEM block"
+      }
+    },
+    {
+      "name": "optional.KeyPEMBlock",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT key PEM block",
+        "zh_CN": "MQTT key PEM block"
+      },
+      "label": {
+        "en_US": "MQTT key PEM block",
+        "zh_CN": "MQTT key PEM block"
+      }
+    },
+    {
+      "name": "optional.SkipCertVerify",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT skip cert verify",
+        "zh_CN": "MQTT skip cert verify"
+      },
+      "label": {
+        "en_US": "MQTT skip cert verify",
+        "zh_CN": "MQTT skip cert verify"
+      }
+    }
+  ]
+}

+ 21 - 0
etc/sinks/internal/log.json

@@ -0,0 +1,21 @@
+{
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "EMQ",
+      "email": "contact@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/rules/sinks/mqtt.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/rules/sinks/mqtt.md"
+    },
+    "description": {
+      "en_US": "The action is used for print output message into log file, the log file is at $kuiper_install/log/stream.log by default.",
+      "zh_CN": "该操作用于将输出消息打印到日志文件中,默认情况下,该日志文件位于 $kuiper_install/log/stream.log 中。"
+    }
+  },
+  "properties": [
+  ]
+}

+ 180 - 0
etc/sinks/internal/mqtt.json

@@ -0,0 +1,180 @@
+{
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "EMQ",
+      "email": "contact@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/rules/sinks/mqtt.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/rules/sinks/mqtt.md"
+    },
+    "description": {
+      "en_US": "The action is used for publish output message into an MQTT server.",
+      "zh_CN": "该操作用于将输出消息发布到 MQTT 服务器中"
+    }
+  },
+  "properties": [
+    {
+      "name": "server",
+      "default": "tcp://127.0.0.1:1883",
+      "optional": false,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The broker address of the MQTT server, such as tcp://127.0.0.1:1883.",
+        "zh_CN": "MQTT 服务器地址,例如 tcp://127.0.0.1:1883"
+      },
+      "label": {
+        "en_US": "MQTT broker address",
+        "zh_CN": "MQTT 服务器地址"
+      }
+    },
+    {
+      "name": "topic",
+      "optional": false,
+      "control": "text",
+      "default": "",
+      "type": "string",
+      "hint": {
+        "en_US": "The MQTT topic, such as analysis/result",
+        "zh_CN": "MQTT 主题,例如 analysis/result"
+      },
+      "label": {
+        "en_US": "MQTT topic",
+        "zh_CN": "MQTT 主题"
+      }
+    },
+    {
+      "name": "clientId",
+      "optional": true,
+      "control": "text",
+      "default": "",
+      "type": "string",
+      "hint": {
+        "en_US": "The client id for MQTT connection. If not specified, an uuid will be used",
+        "zh_CN": "MQTT 连接的客户端 ID。 如果未指定,将使用一个 uuid"
+      },
+      "label": {
+        "en_US": "MQTT ClinetID",
+        "zh_CN": "MQTT 客户端标识符(ClinetID)"
+      }
+    },
+    {
+      "name": "protocolVersion",
+      "default": "3.1",
+      "optional": true,
+      "control": "select",
+      "values": [
+        "3.1",
+        "3.1.1"
+      ],
+      "type": "string",
+      "hint": {
+        "en_US": "MQTT protocol version. 3.1 (also refer as MQTT 3) or 3.1.1 (also refer as MQTT 4).  If not specified, the default value is 3.1.",
+        "zh_CN": "MQTT 协议版本。3.1 (也被称为 MQTT 3) 或者 3.1.1 (也被称为 MQTT 4)。 如果未指定,缺省值为 3.1。"
+      },
+      "label": {
+        "en_US": "MQTT protocol version",
+        "zh_CN": "MQTT 协议版本"
+      }
+    },
+    {
+      "name": "qos",
+      "default": 0,
+      "optional": true,
+      "control": "select",
+      "values": [
+        0,
+        1,
+        2
+      ],
+      "type": "list_int",
+      "hint": {
+        "en_US": "The QoS for message delivery.",
+        "zh_CN": "消息转发的服务质量"
+      },
+      "label": {
+        "en_US": "QoS",
+        "zh_CN": "QoS"
+      }
+    },
+    {
+      "name": "username",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The username for the connection.",
+        "zh_CN": "连接用户名"
+      },
+      "label": {
+        "en_US": "Username",
+        "zh_CN": "用户名"
+      }
+    },
+    {
+      "name": "password",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The password for the connection.",
+        "zh_CN": "连接密码。"
+      },
+      "label": {
+        "en_US": "Password",
+        "zh_CN": "密码"
+      }
+    },
+    {
+      "name": "certificationPath",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The certification path. It can be an absolute path, or a relative path. If it is an relative path, then the base path is where you excuting the server command. For example, if you run bin/server from /var/kuiper, then the base path is /var/kuiper; If you run ./server from /var/kuiper/bin, then the base path is /var/kuiper/bin.",
+        "zh_CN": "证书路径。可以为绝对路径,也可以为相对路径。如果指定的是相对路径,那么父目录为执行 server 命令的路径。比如,如果你在 /var/kuiper 中运行 bin/server ,那么父目录为 /var/kuiper; 如果运行从 /var/kuiper/bin 中运行./server,那么父目录为 /var/kuiper/bin"
+      },
+      "label": {
+        "en_US": "Certification path",
+        "zh_CN": "证书路径"
+      }
+    },
+    {
+      "name": "privateKeyPath",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The private key path. It can be either absolute path, or relative path, which is similar to use of certificationPath.",
+        "zh_CN": "私钥路径。可以为绝对路径,也可以为相对路径,相对路径的用法与 certificationPath 类似"
+      },
+      "label": {
+        "en_US": "Certification path",
+        "zh_CN": "证书路径"
+      }
+    },
+    {
+      "name": "insecureSkipVerify",
+      "default": true,
+      "optional": true,
+      "control": "radio",
+      "type": "bool",
+      "hint": {
+        "en_US": "If InsecureSkipVerify is true, TLS accepts any certificate presented by the server and any host name in that certificate.  In this mode, TLS is susceptible to man-in-the-middle attacks. The default value is false. The configuration item can only be used with TLS connections.",
+        "zh_CN": "如果 InsecureSkipVerify 设置为 true, TLS接受服务器提供的任何证书以及该证书中的任何主机名。 在这种模式下,TLS容易受到中间人攻击。默认值为false。配置项只能用于TLS连接。"
+      },
+      "label": {
+        "en_US": "Insecure skip verify",
+        "zh_CN": "非安全跳过验证"
+      }
+    }
+  ]
+}

+ 36 - 0
etc/sinks/internal/nop.json

@@ -0,0 +1,36 @@
+{
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "EMQ",
+      "email": "contact@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/rules/sinks/nop.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/rules/sinks/nop.md"
+    },
+    "description": {
+      "en_US": "The action is an Nop sink, the result sent to this sink will be ignored. ",
+      "zh_CN": "空操作目标,所有发送到此的结果将被忽略。"
+    }
+  },
+  "properties": [
+    {
+      "name": "log",
+      "default": false,
+      "optional": true,
+      "control": "radio",
+      "type": "bool",
+      "hint": {
+        "en_US": "Print the sink result to log or not. By default is false, that will not print the result to log file.",
+        "zh_CN": "是否将结果打印到日志。缺省为 false,这种情况下将不会打印到日志文件。"
+      },
+      "label": {
+        "en_US": "Print log",
+        "zh_CN": "打印日志"
+      }
+    }
+  ]
+}

+ 142 - 0
etc/sinks/internal/rest.json

@@ -0,0 +1,142 @@
+{
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "EMQ",
+      "email": "contact@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/rules/sinks/rest.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/rules/sinks/rest.md"
+    },
+    "description": {
+      "en_US": "The action is used for publish output message into a RESTful API.",
+      "zh_CN": "该动作用于将输出消息发布到 RESTful API 中。"
+    }
+  },
+  "properties": [
+    {
+      "name": "url",
+      "default": "",
+      "optional": false,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The RESTful API endpoint, such as https://www.example.com/api/dummy",
+        "zh_CN": "RESTful API 终端地址,例如 https://www.example.com/api/dummy"
+      },
+      "label": {
+        "en_US": "URL",
+        "zh_CN": "地址"
+      }
+    },
+    {
+      "name": "method",
+      "optional": true,
+      "control": "select",
+      "default": "GET",
+      "type": "list_string",
+      "values": [
+        "GET",
+        "POST",
+        "PUT",
+        "DELETE",
+        "HEAD"
+      ],
+      "hint": {
+        "en_US": "The HTTP method for the RESTful API.",
+        "zh_CN": "RESTful API 的 HTTP 方法。"
+      },
+      "label": {
+        "en_US": "HTTP method",
+        "zh_CN": "HTTP 方法"
+      }
+    },
+    {
+      "name": "bodyType",
+      "optional": true,
+      "control": "select",
+      "default": "none",
+      "type": "list_string",
+      "values": [
+        "none",
+        "json",
+        "text",
+        "html",
+        "xml",
+        "javascript",
+        "form"
+      ],
+      "hint": {
+        "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.",
+        "zh_CN": "消息体的类型。对于 \"get\" 和 \"head\",不需要正文,因此默认值为 \"none\"。 对于其他 http 方法,默认值为 \"json\"。对于 \"html\",\"xml\" 和 \"javascript\",必须仔细设置 dataTemplate 以确保格式正确。"
+      },
+      "label": {
+        "en_US": "Body type",
+        "zh_CN": "消息体类型"
+      }
+    },
+    {
+      "name": "timeout",
+      "default": 5000,
+      "optional": true,
+      "control": "text",
+      "type": "int",
+      "hint": {
+        "en_US": "The timeout (milliseconds) for a HTTP request, defaults to 5000 ms",
+        "zh_CN": "HTTP 请求超时的时间(毫秒),默认为5000毫秒"
+      },
+      "label": {
+        "en_US": "Timeout(ms)",
+        "zh_CN": "超时(ms)"
+      }
+    },
+    {
+      "name": "headers",
+      "default": "",
+      "optional": true,
+      "control": "text",
+      "type": "string",
+      "hint": {
+        "en_US": "The additional headers to be set for the HTTP request.",
+        "zh_CN": "要为 HTTP 请求设置的其他标头"
+      },
+      "label": {
+        "en_US": "HTTP headers",
+        "zh_CN": "HTTP 头"
+      }
+    },
+    {
+      "name": "insecureSkipVerify",
+      "default": true,
+      "optional": true,
+      "control": "radio",
+      "type": "bool",
+      "hint": {
+        "en_US": "Control if to skip the certification verification. If it is set to true, then skip certification verification; Otherwise, verify the certification.",
+        "zh_CN": "控制是否跳过证书认证。如果被设置为 true,那么跳过证书认证;否则进行证书验证。"
+      },
+      "label": {
+        "en_US": "Certification verification",
+        "zh_CN": "证书验证"
+      }
+    },
+    {
+      "name": "debugResp",
+      "default": true,
+      "optional": true,
+      "control": "radio",
+      "type": "bool",
+      "hint": {
+        "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.",
+        "zh_CN": "控制是否将响应信息打印到控制台中。 如果将其设置为 true,则打印响应;如果设置为 false,则跳过打印日志。"
+      },
+      "label": {
+        "en_US": "Print HTTP response",
+        "zh_CN": "打印 HTTP 响应"
+      }
+    }
+  ]
+}

plugins/sinks/options.json → etc/sinks/options.json


plugins/sinks/properties.json → etc/sinks/properties.json


plugins/sinks/taos.json → etc/sinks/taos.json


plugins/sinks/zmq.json → etc/sinks/zmq.json


+ 308 - 287
etc/sources/edgex.json

@@ -1,289 +1,310 @@
 {
-	"about": {
-		"trial": false,
-	"author": {
-		"name": "Jiyong Huang",
-		"email": "huangjy@emqx.io",
-		"company": "EMQ Technologies Co., Ltd",
-		"website": "https://www.emqx.io"
-	},
-	"helpUrl": {
-		"en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/rules/sources/edgex.md",
-		"zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/rules/sources/edgex.md"
-	},
-		"description": {
-			"en_US": "Kuiper provides built-in support for EdgeX source stream, which can subscribe the message from EdgeX message bus and feed into the Kuiper streaming process pipeline.",
-			"zh_CN": "Kuiper 提供了内置的 EdgeX 源支持,它可以被用来订阅来自于EdgeX 消息总线的数据,并且将数据放入 Kuiper 数据处理流水线中。"
-		}
-	},
-	"libs": [],
-	"properties": {
-		"default": [{
-			"name": "protocol",
-			"default": "tcp",
-			"optional": false,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The protocol connect to EdgeX message bus, default value is tcp.",
-				"zh_CN": "连接到 EdgeX 消息总线的协议"
-			},
-			"label": {
-				"en_US": "Protocol",
-				"zh_CN": "协议"
-			}
-		}, {
-			"name": "server",
-			"default": "localhost",
-			"optional": false,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The server address of EdgeX message bus, default value is localhost.",
-				"zh_CN": "EdgeX 消息总线的地址。"
-			},
-			"label": {
-				"en_US": "Server address",
-				"zh_CN": "地址"
-			}
-		}, {
-			"name": "port",
-			"default": 5573,
-			"optional": false,
-			"control": "text",
-			"type": "int",
-			"hint": {
-				"en_US": "The port of EdgeX message bus, default value is 5573.",
-				"zh_CN": "EdgeX 消息总线的端口"
-			},
-			"label": {
-				"en_US": "Port",
-				"zh_CN": "端口"
-			}
-		}, {
-			"name": "topic",
-			"default": "events",
-			"optional": false,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The topic name of EdgeX message bus, default value is events.",
-				"zh_CN": "EdgeX 消息总线上监听的主题名称"
-			},
-			"label": {
-				"en_US": "Topic",
-				"zh_CN": "主题"
-			}
-		}, {
-			"name": "serviceServer",
-			"default": "",
-			"optional": false,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The base service address for getting value descriptors, the value of serviceServer will be concatenated to /api/v1/valuedescriptor to get all of value descriptors of EdgeX server.",
-				"zh_CN": "访问 value descriptors 的基础服务地址,配置项 serviceServer 的值与 /api/v1/valuedescriptor 拼接后,用于获取 EdgeX 服务器上定义的所有 value descriptors。"
-			},
-			"label": {
-				"en_US": "Service address",
-				"zh_CN": "地址"
-			}
-		}, {
-			"name": "type",
-			"default": "",
-			"optional": false,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The EdgeX message bus type, currently two types of message buses are supported. If specified other values, then will use the default zero value.",
-				"zh_CN": "EdgeX 消息总线类型,目前支持两种消息总线。如果指定了错误的消息总线类型,那么会使用缺省 zero 类型。"
-			},
-			"label": {
-				"en_US": "Type",
-				"zh_CN": "类型"
-			}
-		}, {
-			"name": "optional",
-			"default": [{
-				"name": "ClientId",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "Username",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "Password",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "Qos",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "KeepAlive",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "Retained",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "ConnectionPayload",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "CertFile",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "KeyFile",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "CertPEMBlock",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "KeyPEMBlock",
-				"default": "",
-				"optional": true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}, {
-				"name": "SkipCertVerify",
-				"default": "",
-				"optional":true,
-				"control": "text",
-				"type": "string",
-				"hint": {
-					"en_US": "",
-					"zh_CN": ""
-				},
-				"label": {
-					"en_US": "",
-					"zh_CN": ""
-				}
-			}],
-			"optional":true,
-			"control": "text",
-			"type": "obj-list",
-			"hint": {
-				"en_US": "If MQTT message bus is used, some other optional configurations can be specified. Please notice that all of values in optional are string type, so values for these configurations should be string - such as KeepAlive: \"5000\".",
-				"zh_CN": "如果使用了 MQTT 消息总线,还可以指定别的一些可选配置项。请注意,所有在可选的配置项里指定的值都必须为**字符类型**,因此这里出现的所有的配置应该是字符类型的 - 例如 KeepAlive: \"5000\"。"
-			},
-			"label": {
-				"en_US": "Optional",
-				"zh_CN": "选项"
-			}
-		}]
-	}
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "Jiyong Huang",
+      "email": "huangjy@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/rules/sources/edgex.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/rules/sources/edgex.md"
+    },
+    "description": {
+      "en_US": "Kuiper provides built-in support for EdgeX source stream, which can subscribe the message from EdgeX message bus and feed into the Kuiper streaming process pipeline.",
+      "zh_CN": "Kuiper 提供了内置的 EdgeX 源支持,它可以被用来订阅来自于EdgeX 消息总线的数据,并且将数据放入 Kuiper 数据处理流水线中。"
+    }
+  },
+  "libs": [],
+  "properties": {
+    "default": [
+      {
+        "name": "protocol",
+        "default": "tcp",
+        "optional": false,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The protocol connect to EdgeX message bus, default value is tcp.",
+          "zh_CN": "连接到 EdgeX 消息总线的协议"
+        },
+        "label": {
+          "en_US": "Protocol",
+          "zh_CN": "协议"
+        }
+      },
+      {
+        "name": "server",
+        "default": "localhost",
+        "optional": false,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The server address of EdgeX message bus, default value is localhost.",
+          "zh_CN": "EdgeX 消息总线的地址。"
+        },
+        "label": {
+          "en_US": "Server address",
+          "zh_CN": "地址"
+        }
+      },
+      {
+        "name": "port",
+        "default": 5573,
+        "optional": false,
+        "control": "text",
+        "type": "int",
+        "hint": {
+          "en_US": "The port of EdgeX message bus, default value is 5573.",
+          "zh_CN": "EdgeX 消息总线的端口"
+        },
+        "label": {
+          "en_US": "Port",
+          "zh_CN": "端口"
+        }
+      },
+      {
+        "name": "topic",
+        "default": "events",
+        "optional": false,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The topic name of EdgeX message bus, default value is events.",
+          "zh_CN": "EdgeX 消息总线上监听的主题名称"
+        },
+        "label": {
+          "en_US": "Topic",
+          "zh_CN": "主题"
+        }
+      },
+      {
+        "name": "serviceServer",
+        "default": "",
+        "optional": false,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The base service address for getting value descriptors, the value of serviceServer will be concatenated to /api/v1/valuedescriptor to get all of value descriptors of EdgeX server.",
+          "zh_CN": "访问 value descriptors 的基础服务地址,配置项 serviceServer 的值与 /api/v1/valuedescriptor 拼接后,用于获取 EdgeX 服务器上定义的所有 value descriptors。"
+        },
+        "label": {
+          "en_US": "Service address",
+          "zh_CN": "地址"
+        }
+      },
+      {
+        "name": "type",
+        "default": "",
+        "optional": false,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The EdgeX message bus type, currently two types of message buses are supported. If specified other values, then will use the default zero value.",
+          "zh_CN": "EdgeX 消息总线类型,目前支持两种消息总线。如果指定了错误的消息总线类型,那么会使用缺省 zero 类型。"
+        },
+        "label": {
+          "en_US": "Type",
+          "zh_CN": "类型"
+        }
+      },
+      {
+        "name": "optional",
+        "default": [
+          {
+            "name": "ClientId",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "Username",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "Password",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "Qos",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "KeepAlive",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "Retained",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "ConnectionPayload",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "CertFile",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "KeyFile",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "CertPEMBlock",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "KeyPEMBlock",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          },
+          {
+            "name": "SkipCertVerify",
+            "default": "",
+            "optional": true,
+            "control": "text",
+            "type": "string",
+            "hint": {
+              "en_US": "",
+              "zh_CN": ""
+            },
+            "label": {
+              "en_US": "",
+              "zh_CN": ""
+            }
+          }
+        ],
+        "optional": true,
+        "control": "text",
+        "type": "obj-list",
+        "hint": {
+          "en_US": "If MQTT message bus is used, some other optional configurations can be specified. Please notice that all of values in optional are string type, so values for these configurations should be string - such as KeepAlive: \"5000\".",
+          "zh_CN": "如果使用了 MQTT 消息总线,还可以指定别的一些可选配置项。请注意,所有在可选的配置项里指定的值都必须为**字符类型**,因此这里出现的所有的配置应该是字符类型的 - 例如 KeepAlive: \"5000\"。"
+        },
+        "label": {
+          "en_US": "Optional",
+          "zh_CN": "选项"
+        }
+      }
+    ]
+  }
 }

+ 99 - 94
etc/sources/random.json

@@ -1,97 +1,102 @@
 {
-	"libs": [
-		"github.com/pebbe/zmq4@master"
-	],
-	"about": {
-		"trial": false,
-	"author": {
-		"name": "Jiyong Huang",
-		"email": "huangjy@emqx.io",
-		"company": "EMQ Technologies Co., Ltd",
-		"website": "https://www.emqx.io"
-	},
-	"helpUrl": {
-		"en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/plugins/sources/random.md",
-		"zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/plugins/sources/random.md"
-	},
-		"description": {
-			"en_US": "he source will generate random inputs with a specified pattern.",
-			"zh_CN": "随机源将生成具有指定样式的随机输入。"
-		}
-	},
-	"properties": {
-		"default": [{
-			"name": "interval",
-			"default": 1000,
-			"optional": false,
-			"control": "text",
-			"type": "int",
-			"hint": {
-				"en_US": "The interval (ms) to issue a message",
-				"zh_CN": "发出消息的间隔(毫秒)"
-			},
-			"label": {
-				"en_US": "Interval",
-				"zh_CN": "间隔时间"
-			}
-		}, {
-			"name": "seed",
-			"default": 1,
-			"optional": true,
-			"control": "text",
-			"type": "int",
-			"hint": {
-				"en_US": "The maximum integer to be produced by the random function",
-				"zh_CN": "随机函数产生的最大整数"
-			},
-			"label": {
-				"en_US": "Seed",
-				"zh_CN": "最大整数"
-			}
-		}, {
-			"name": "deduplicate",
-			"default": 0,
-			"optional": true,
-			"control": "text",
-			"type": "int",
-			"hint": {
-				"en_US": "An int value. If it is a positive number, the source will not issue the messages which are duplicates of any of the previous 'deduplicate' length of messages. If it is 0, the source won't check for duplications. If it is a negative number, the source will check for duplicates over any previous messages. Do not use negative length if you have very large input data sets as all the previous data will be kept.",
-				"zh_CN": "一个整数值。 如果它为正数,则源不会发出与以前任何“重复数据删除”长度的消息重复的消息。如果为0,则源不会检查是否存在重复。如果是负数,则源将检查以前任何消息的重复项。如果有非常大的输入数据集,请不要使用负长度,因为将保留所有以前的数据。"
-			},
-			"label": {
-				"en_US": "Deduplicate",
-				"zh_CN": "去除重复"
-			}
-		}, {
-			"name": "pattern",
-			"default": [
-        {
-          "name": "count",
-          "default": 50,
-          "optional": true,
-          "control": "text",
-          "type": "int",
-          "hint": {
-            "en_US": "User-defined fields",
-            "zh_CN": "用户自定义字段名"
-          },  
-          "label": {
-            "en_US": "Fields", 
-            "zh_CN": "字段名"
-          }   
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "Jiyong Huang",
+      "email": "huangjy@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/plugins/sources/random.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/plugins/sources/random.md"
+    },
+    "description": {
+      "en_US": "he source will generate random inputs with a specified pattern.",
+      "zh_CN": "随机源将生成具有指定样式的随机输入。"
+    }
+  },
+  "libs": [
+    "github.com/pebbe/zmq4@master"
+  ],
+  "properties": {
+    "default": [
+      {
+        "name": "interval",
+        "default": 1000,
+        "optional": false,
+        "control": "text",
+        "type": "int",
+        "hint": {
+          "en_US": "The interval (ms) to issue a message",
+          "zh_CN": "发出消息的间隔(毫秒)"
+        },
+        "label": {
+          "en_US": "Interval",
+          "zh_CN": "间隔时间"
         }
-    ],
-			"optional": true,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The pattern to be generated by the source",
-				"zh_CN": "源生成的样式"
-			},
-			"label": {
-				"en_US": "Pattern",
-				"zh_CN": "样式"
-			}
-		}]
-	}
+      },
+      {
+        "name": "seed",
+        "default": 1,
+        "optional": true,
+        "control": "text",
+        "type": "int",
+        "hint": {
+          "en_US": "The maximum integer to be produced by the random function",
+          "zh_CN": "随机函数产生的最大整数"
+        },
+        "label": {
+          "en_US": "Seed",
+          "zh_CN": "最大整数"
+        }
+      },
+      {
+        "name": "deduplicate",
+        "default": 0,
+        "optional": true,
+        "control": "text",
+        "type": "int",
+        "hint": {
+          "en_US": "An int value. If it is a positive number, the source will not issue the messages which are duplicates of any of the previous 'deduplicate' length of messages. If it is 0, the source won't check for duplications. If it is a negative number, the source will check for duplicates over any previous messages. Do not use negative length if you have very large input data sets as all the previous data will be kept.",
+          "zh_CN": "一个整数值。 如果它为正数,则源不会发出与以前任何“重复数据删除”长度的消息重复的消息。如果为0,则源不会检查是否存在重复。如果是负数,则源将检查以前任何消息的重复项。如果有非常大的输入数据集,请不要使用负长度,因为将保留所有以前的数据。"
+        },
+        "label": {
+          "en_US": "Deduplicate",
+          "zh_CN": "去除重复"
+        }
+      },
+      {
+        "name": "pattern",
+        "default": [
+          {
+            "name": "count",
+            "default": 50,
+            "optional": true,
+            "control": "text",
+            "type": "int",
+            "hint": {
+              "en_US": "User-defined fields",
+              "zh_CN": "用户自定义字段名"
+            },
+            "label": {
+              "en_US": "Fields",
+              "zh_CN": "字段名"
+            }
+          }
+        ],
+        "optional": true,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The pattern to be generated by the source",
+          "zh_CN": "源生成的样式"
+        },
+        "label": {
+          "en_US": "Pattern",
+          "zh_CN": "样式"
+        }
+      }
+    ]
+  }
 }

+ 54 - 51
etc/sources/zmq.json

@@ -1,53 +1,56 @@
 {
-	"about": {
-		"trial": false,
-	"author": {
-		"name": "Jiyong Huang",
-		"email": "huangjy@emqx.io",
-		"company": "EMQ Technologies Co., Ltd",
-		"website": "https://www.emqx.io"
-	},
-	"helpUrl": {
-		"en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/plugins/sources/zmq.md",
-		"zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/plugins/sources/zmq.md"
-	},
-		"description": {
-			"en_US": "The source will subscribe to a Zero Mq topic to import the messages into kuiper.",
-			"zh_CN": "源将订阅 Zero Mq 主题以将消息导入 kuiper。"
-		}
-	},
-	"libs": [
-		"github.com/pebbe/zmq4@master"
-	],
-	"properties": {
-		"default": [{
-			"name": "server",
-			"default": "127.0.0.1:5536",
-			"optional": false,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The url of the Zero Mq server",
-				"zh_CN": "Zero Mq 服务器的 URL"
-			},
-			"label": {
-				"en_US": "server address",
-				"zh_CN": "服务器地址"
-			}
-		}, {
-			"name": "topic",
-			"default": "",
-			"optional": true,
-			"control": "text",
-			"type": "string",
-			"hint": {
-				"en_US": "The topic to publish to.",
-				"zh_CN": "订阅主题"
-			},
-			"label": {
-				"en_US": "topic",
-				"zh_CN": "主题"
-			}
-		}]
-	}
+  "about": {
+    "trial": false,
+    "author": {
+      "name": "Jiyong Huang",
+      "email": "huangjy@emqx.io",
+      "company": "EMQ Technologies Co., Ltd",
+      "website": "https://www.emqx.io"
+    },
+    "helpUrl": {
+      "en_US": "https://github.com/emqx/kuiper/blob/master/docs/en_US/plugins/sources/zmq.md",
+      "zh_CN": "https://github.com/emqx/kuiper/blob/master/docs/zh_CN/plugins/sources/zmq.md"
+    },
+    "description": {
+      "en_US": "The source will subscribe to a Zero Mq topic to import the messages into kuiper.",
+      "zh_CN": "源将订阅 Zero Mq 主题以将消息导入 kuiper。"
+    }
+  },
+  "libs": [
+    "github.com/pebbe/zmq4@master"
+  ],
+  "properties": {
+    "default": [
+      {
+        "name": "server",
+        "default": "127.0.0.1:5536",
+        "optional": false,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The url of the Zero Mq server",
+          "zh_CN": "Zero Mq 服务器的 URL"
+        },
+        "label": {
+          "en_US": "server address",
+          "zh_CN": "服务器地址"
+        }
+      },
+      {
+        "name": "topic",
+        "default": "",
+        "optional": true,
+        "control": "text",
+        "type": "string",
+        "hint": {
+          "en_US": "The topic to publish to.",
+          "zh_CN": "订阅主题"
+        },
+        "label": {
+          "en_US": "topic",
+          "zh_CN": "主题"
+        }
+      }
+    ]
+  }
 }

+ 26 - 11
plugins/sinkMeta.go

@@ -80,6 +80,9 @@ type (
 	}
 )
 
+//const internal sinks
+var InternalSinks = [...]string{"log", "mqtt", "rest", "nop", "edgex"}
+
 func newLanguage(fi *fileLanguage) *language {
 	if nil == fi {
 		return nil
@@ -130,32 +133,44 @@ func newUiSink(fi *fileSink) *uiSink {
 
 var g_sinkMetadata map[string]*uiSink //map[fileName]
 func readSinkMetaDir() error {
-	confDir, err := common.GetLoc("/plugins")
+	confDir, err := common.GetConfLoc()
 	if nil != err {
 		return err
 	}
 
 	dir := path.Join(confDir, "sinks")
 	tmpMap := make(map[string]*uiSink)
-	infos, err := ioutil.ReadDir(dir)
+
+	//The internal support sinks
+	for _, sink := range InternalSinks {
+		file := path.Join(confDir, "sinks", "internal", sink + ".json")
+		common.Log.Infof("Loading metadata file for sink: %s", file)
+		meta := new(uiSink)
+		err := common.ReadJsonUnmarshal(file, meta)
+		if nil != err {
+			return fmt.Errorf("Failed to load internal sink plugin:%s with err:%v", file, err)
+		}
+		tmpMap[sink + ".json"] = meta
+	}
+	files, err := ioutil.ReadDir(dir)
 	if nil != err {
 		return err
 	}
-	for _, info := range infos {
-		fileName := info.Name()
-		if !strings.HasSuffix(fileName, ".json") {
+	for _, file := range files {
+		fname := file.Name()
+		if !strings.HasSuffix(fname, ".json") {
 			continue
 		}
 
-		filePath := path.Join(dir, fileName)
-		ptrMetadata := new(fileSink)
-		err = common.ReadJsonUnmarshal(filePath, ptrMetadata)
+		filePath := path.Join(dir, fname)
+		metadata := new(fileSink)
+		err = common.ReadJsonUnmarshal(filePath, metadata)
 		if nil != err {
-			return fmt.Errorf("fileName:%s err:%v", fileName, err)
+			return fmt.Errorf("fname:%s err:%v", fname, err)
 		}
 
-		common.Log.Infof("sinkMeta file : %s", fileName)
-		tmpMap[fileName] = newUiSink(ptrMetadata)
+		common.Log.Infof("sinkMeta file : %s", fname)
+		tmpMap[fname] = newUiSink(metadata)
 	}
 	g_sinkMetadata = tmpMap
 	return nil