Page 1 of 1

Change 'Config->Servers' details via api?

Posted: March 5th, 2010, 9:42 am
by GhostGum
Hi

I have a requirement to auto update my usenet servers info (the info in 'Config->Servers' tab).
Specifically, i want to change the username & password for a server.

So i made an app which runs on my sabnzbd box to do the following:
* search for sabnzbd process.
* close sabnzbd process.
* Modify sabnzbd config file, to new server info.
* start new sabnzbd process.

This works fine, but is not the greatest of solutions.
I was wondering if there is a way to do this via api?
I dont see it mentioned here anywhere: http://sabnzbd.wikidot.com/api
Would this be a reasonable feature request?
If such a feature was implimented would it pose a security risk (eg, anything/anyone that i give my api key to could potentially change my server info, to connect to their own server of malicious design?).

No biggie, as for my purposes i can keep doing it the ugly way i am, but thought i'd throw the request out there in hopes that it is one day implemented.

edit - well i just noticed that instead of closing sabnzb process i should be using something like http://host:port/sabnzbd/shutdown
That should ensure a correct shutdown.

edit2 - Resolution: "mode=set_config&section=servers&name=SERVERNAME&username=SERVERUSERNAME&password=SERVERPASSWORD"


Cheers.

Re: Change 'Config->Servers' details via api?

Posted: March 5th, 2010, 10:14 am
by shypike
The code is already there, it's just the Wiki page that's not up to date.
We are working on that.

Re: Change 'Config->Servers' details via api?

Posted: March 6th, 2010, 11:40 am
by GhostGum
Thanks for the reply.
Good to hear this is possible, Ill have at sources then.

edit - ok i have had a look at source & found the following api command will do what i require:
mode=set_config&section=servers&name=SERVERNAME&username=SERVERUSERNAME&password=SERVERPASSWORD

Cheers.