Source/Sink in rules can be created and managed independently in the form of connections.
To create a connection, provide the connection's id, type, and configuration parameters. Currently, mqtt
/nng
/httppush
/websocket
/edgex
/sql
type connections are supported. Here we take creating an mqtt connection as an example.
POST http://localhost:9081/connections
{
"id": "connecton-1",
"typ":"mqtt",
"props": {
"server": "tcp://127.0.0.1:1883"
}
}
To update a connection, provide the connection's id, type, and configuration parameters. Currently, mqtt
/nng
/httppush
/websocket
/edgex
/sql
types of connections are supported. Here we take updating the mqtt connection as an example. If the connection is referenced by a rule, it cannot be updated.
PUT http://localhost:9081/connections/connection-1
{
"id": "connecton-1",
"typ":"mqtt",
"props": {
"server": "tcp://127.0.0.1:1883"
}
}
GET http://localhost:9081/connections
Return all connections' information and status.
GET http://localhost:9081/connections/{id}
When deleting a connection, it will check whether there are rules using the connection. If there are rules using the connection, the connection cannot be deleted.
DELETE http://localhost:9081/connections/{id}
Check eKuiper connection connectivity via API
POST http://localhost:9081/metadata/sinks/connection/{sink}
{
"configuration": "xxxx"
}
The sink-side connection check will check the connectivity of the connection based on the incoming sinkType and configuration. Take mysql Sink as an example:
POST http://localhost:9081/metadata/sinks/connection/sql
{
"url": "mysql://[email protected]:4000/test",
"table": "test",
"fields": ["a","b","c"]
}
POST http://localhost:9081/metadata/sources/connection/{source}
{
"configuration": "xxxx"
}
The source-side connection check will check the connectivity of the connection based on the incoming sourceType and configuration. Take mysql Source as an example:
POST http://localhost:9081/metadata/sources/connection/sql
{
"url": "mysql://[email protected]:4000/test",
}