eKuiper REST api allows you to manage Config Keys, e.g. list, delete, register.
# List all configKey
This API is used to get all Config Keys under a specific source name
GET http://localhost:9081/metadata/sources/yaml/{name}
# Parameter
name:Source name, supports built-in sources and extended sources. The built-in sources include mqtt, redis, neuron, memory, httppull, httppush, file, edgex, Extended sources include random, sql, video, zmq and user-defined sources
# Example
Example request to get all Config Keys from an MQTT source:
curl http://localhost:9081/metadata/sources/yaml/mqtt
{
"amd_broker": {
"insecureSkipVerify": false,
"protocolVersion": "3.1.1",
"qos": 1,
"server": "tcp://122.9.166.75:1883",
"password": "******"
},
"default": {
"qos": 2,
"server": "tcp://emqx:1883"
},
"demo_conf": {
"qos": 0,
"server": "tcp://10.211.55.6:1883"
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Note: When retrieving Config Keys, if the properties contain a password field (case-insensitive, such as Password), the API will not return the actual password value, but instead replace it with "******" to conceal the password information.
# Delete a configKey
This API is used to delete a Config Key configuration under a specific source name
DELETE http://localhost:9081/metadata/sources/{name}/confKeys/{confKey}
# Parameter
- name:Source name, supports built-in sources and extended sources. The built-in sources include mqtt, redis, neuron, memory, httppull, httppush, file, edgex, Extended sources include random, sql, video, zmq and user-defined sources
- confKey: Config Key Name。Taking the above as an example, the Config Keys are amd_broker, default, demo_conf in sequence.
# Example
Delete the Config Key named demo_conf under the MQTT source
curl -X DELETE http://localhost:9081/metadata/sources/mqtt/confKeys/demo_conf
# Register a configKey
This API is used to register a Config Key under a specific source name
PUT http://localhost:9081/metadata/sources/{name}/confKeys/{confKey}
# Parameter
- name:Source name, supports built-in sources and extended sources. The built-in sources include mqtt, redis, neuron, memory, httppull, httppush, file, edgex, Extended sources include random, sql, video, zmq and user-defined sources
- confKey: Config Key name to register
# Example
Register the Config Key named demo_conf under the MQTT source
curl -X PUT http://localhost:9081/metadata/sources/mqtt/confKeys/demo_conf
{
"demo_conf": {
"qos": 0,
"server": "tcp://10.211.55.6:1883"
}
}
2
3
4
5
6
7