I want to add new connections in storage plugins through my code. Would you please tell how to add or configure connections in storage plugin programmatically in c#<
As per the drill's docs, you can add plugin:
Using WEB UI
As per docs,
Go to: http://localhost:8047/storage (replace localhost bt IP/hostname if drill is running on remote machine)
Add New Storage Plugin (say name sql) & click create.
Put config there:
{
type: "jdbc",
enabled: true,
driver: "com.microsoft.sqlserver.jdbc.SQLServerDriver",
url:"jdbc:sqlserver://1.2.3.4:1433;databaseName=mydatabase",
username:"user",
password:"password"
}
It will return success if your credentials are right.
Check docs for sql-server plugin.
Note: Make sure you added sqljdbc41.4.2.6420.100.jar
in
Using REST API
As per docs,
curl -X POST -H "Content-Type: application/json" -d '{"name":"sql","config": { type: "jdbc", enabled: true, driver: "com.microsoft.sqlserver.jdbc.SQLServerDriver",url:"jdbc:sqlserver://1.2.3.4:1433;databaseName=mydatabase",username:"user", password:"password"}' http://localhost:8047/storage/sql.json
I guess there is no direct way to add plugin via C++ client. You can write code for POST request using C++.