API: issue with set_config & server settings

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
zifnab
Newbie
Newbie
Posts: 13
Joined: January 20th, 2010, 5:06 am

API: issue with set_config & server settings

Post 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).
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: API: issue with set_config & server settings

Post by shypike »

section=servers&keyword=servername&connections=20
zifnab
Newbie
Newbie
Posts: 13
Joined: January 20th, 2010, 5:06 am

Re: API: issue with set_config & server settings

Post by zifnab »

you are the man ;)
thanks!
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: API: issue with set_config & server settings

Post by sander »

zifnab wrote:you are the man ;)
Shypike indeed is! ;)
Post Reply