Page 1 of 1

API: issue with set_config & server settings

Posted: October 11th, 2011, 8:19 pm
by zifnab
hi.
1st & foremost: thanks a lot for this great app!

now, straight to the issue:
using API, I manage to use mode=set_config to change settings in sabnzbd.ini
everything works except, when I want to change a server setting (like 'connections'), due to the fact that each server is a SUB-section of [servers] & mode=set_config doesn't seem to be able to "reach" SUB-sections (just regular sections).

by the way and for the record, I am using v0.6.9 (win32) on win7 x64.

the sabnzbd.ini created by sabnzbd is as follow:

Code: Select all

[servers]
[[secure.usenetserver.com]]
username = xxxxxxx
enable = 1
name = secure.usenetserver.com
fillserver = 0
connections = 10
ssl = 1
host = secure.usenetserver.com
............
here are the things I tried:

- try #1:

Code: Select all

http://localhost:8080/sabnzbd/api?apikey=xxxxxxxxxxxxxxxxxxxxx&mode=set_config&section=servers&keyword=connections&value=20
this one creates a "blank" server and thus returns:

Code: Select all

{'servers': [{'username': '', 'enable': 1, 'name': 'connections', 'fillserver': 0, 'connections': 1, 'ssl': 0, 'host': '', 'timeout': 120, 'password': '', 'optional': 0, 'port': 119, 'retention': 0}]}
- try #2:

Code: Select all

http://localhost:8080/sabnzbd/api?apikey=xxxxxxxxxxxxxxxxxxxxx&mode=set_config&section=servers&keyword=secure.usenetserver.com
does the very same as get config, but syntax reaches its limit: i cannot specify another "keyword=connections"

- try #3:

Code: Select all

http://localhost:8080/sabnzbd/api?apikey=xxxxxxxxxxxxxxxxxxxxx&mode=set_config&section=[secure.usenetserver.com]&keyword=connections&value=20
"error: Config item does not exist"

- try #4:

Code: Select all

http://localhost:8080/sabnzbd/api?apikey=xxxxxxxxxxxxxxxxxxxxx&mode=set_config&section=secure.usenetserver.com&keyword=connections&value=20
"error: Config item does not exist"

any undocumented workaround?
thanks a lot for any help (by the way, I am writing an app/script to "pool" my connections through a web server and dispatch those connections as required among computers on my network).

Re: API: issue with set_config & server settings

Posted: October 12th, 2011, 8:44 am
by shypike
section=servers&keyword=servername&connections=20

Re: API: issue with set_config & server settings

Posted: October 12th, 2011, 9:33 am
by zifnab
you are the man ;)
thanks!

Re: API: issue with set_config & server settings

Posted: October 12th, 2011, 11:35 am
by sander
zifnab wrote:you are the man ;)
Shypike indeed is! ;)