Change 'Config->Servers' details via api?

Want something added? Ask for it here.
Post Reply
GhostGum
Newbie
Newbie
Posts: 2
Joined: March 5th, 2010, 9:10 am

Change 'Config->Servers' details via api?

Post 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.
Last edited by GhostGum on March 6th, 2010, 12:32 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

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

Post by shypike »

The code is already there, it's just the Wiki page that's not up to date.
We are working on that.
GhostGum
Newbie
Newbie
Posts: 2
Joined: March 5th, 2010, 9:10 am

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

Post 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.
Last edited by GhostGum on March 6th, 2010, 12:20 pm, edited 1 time in total.
Post Reply