I am running Apache Drill in Window 8.1 OS, having latest version of Drill (1.7).
I want to enable or disable storage plugin programatically (using C# code).
Is there any way to do so.?
I am running Apache Drill in Window 8.1 OS, having latest version of Drill (1.7).
I want to enable or disable storage plugin programatically (using C# code).
Is there any way to do so.?
You can update drill plugin via REST API.
I am taking MongoDB plugin as an example.
curl -X POST -H "Content-Type: application/json" -d '{"name":"mongoPlugin", "config":{"type":"mongo","enabled":true,"connection":"mongodb://localhost:27017/"}}' http://localhost:8047/storage/mongoPlugin.json
Change "enabled" to false to disable it.
curl -X POST -H "Content-Type: application/json" -d '{"name":"mongoPlugin", "config":{"type":"mongo","enabled":false,"connection":"mongodb://localhost:27017/"}}' http://localhost:8047/storage/mongoPlugin.json
Check drill docs for more details.
You already answered about creating plugins using C#. Just change payload as mentioned above.
For Enabling or Disabling Storage Plugin in Window Environment. First we have to download curl.exe file from Download Curl . Set the path of curl.exe file in Environment Variable:-
Follow these steps:- Download curl zip Extract the contents (if you have downloaded the correct version you should find curl.exe) Place curl.exe in a folder where you keep your software (e.g. D:\software\curl\curl.exe) To run curl from the command line
a) Right-hand-click on "My Computer" icon
b) Select Properties
c) Click 'Advanced system settings' link
d) Go to tab [Advanced] - 'Environment Variables' button
e) Under System variable select 'Path' and Edit button
f) Add a semicolon followed by the path to where you placed your curl.exe (e.g. ;D:\software\curl).
Now Open Command Prompt and run following command:-
For Disabling Storage Plugin:-
curl http://localhost:8047/storage/DemoMySQl/enable/false
For Enabling:-
curl http://localhost:8047/storage/DemoMySQl/enable/true
Note:- DemoMySQl is storage plugin name.