Search code examples
linuxapicronwebmin

Is there a way to access webmin using APIs


I have installed webmin on my centos linux server.

I want to set a cron or list cron jobs using API which I can call through any python or php code. I tried finding any such thing on internet and in webmin documentation, but couldnt find anything.

Has anyone tried this or knows how this thing can be implemented ?

I know I can create a PHP api or python api , which in turn can run shell commands to add crontab, but I am looking native-webmin API.


Solution

  • https://doxfer.webmin.com/Webmin/XML-RPC_Calls documents a way to perform rpc calls. You can, for example, execute such a call using curl with

     curl --data @testcall -k https://root:[email protected]:10000/xmlrpc.cgi
    

    where the content of testcall is

    <?xml version="1.0"?>
     <methodCall>
     <methodName>useradmin::list_users</methodName>
     <params>
     <param>
     <value>apiUser</value>
     </param>
     <param>
     <value>apiKey</value>
     </param>
     </params>
     </methodCall>