Class: SabnzbdPlusModelApi::Api
- Inherits:
-
Object
- Object
- SabnzbdPlusModelApi::Api
- Defined in:
- lib/sabnzbd_plus/model/api/api.rb
Overview
The SABnzbd+ API
Instance Method Summary (collapse)
-
- (Hash<String, String>, ...) addid(options = {})
pp, script, cat and priority are all optional.
-
- (Hash<String, String>, ...) addlocalfile(options = {})
Allows uploading of nzb/rar/zip/gz files by simply providing a local path (has to be accessable by the machine running SABnzbd
Added in 0.3 Priority added in 0.5.
-
- (Hash<String, String>, ...) addurl(options = {})
pp, script, cat and priority are all optional.
-
- (Hash<String, String>, ...) change_cat(options = {})
Added in 0.4.
-
- (Hash<String, String>, ...) change_opts(options = {})
Change value2 to control what post-processing option to use.
-
- (Hash<String, String>, ...) change_script(options = {})
Added in 0.4.
-
- (Hash<String, String>, ...) config(options = {})
Pauses for a set amount of time (value is the time in minutes to pause the queue).
-
- (Hash<String, String>, ...) get_cats
Current categories.
-
- (Hash<String, String>, ...) get_files(options = {})
Retrieve Contents of Queue item.
-
- (Hash<String, String>, ...) get_scripts
Return Scripts.
-
- (Hash<String, String>, ...) history(params = {})
A verbose output that as well as reporting items in the queue, will report on finished items being processed (verify/repaired/extracted) and other details such as categories, scripts.
-
- (Api) initialize(caller = SabnzbdPlusModelApiCaller::HttpJson.new)
constructor
Set-up the Caller to use.
-
- (Hash<String, String>, ...) pause
Pauses the whole queue (do not confuse this will pausing an individual download, this is a global pause).
-
- (Hash<String, String>, ...) qstatus
Depreciated now by the advanced queue output, this is the old api that just provides limited details on the current queue and state of sabnzbd.
-
- (Hash<String, String>, ...) queue(options = {})
A verbose output that as well as reporting items in the queue, will report on finished items being processed (verify/repaired/extracted) and other details such as categories, scripts.
-
- (Hash<String, String>, ...) restart
Restart SABnzbd.
-
- (Hash<String, String>, ...) resume
Resumes the whole queue (do not confuse this will resuming an individual download, this is a global resume)Resumes the whole queue (do not confuse this will resuming an individual download, this is a global resume).
-
- (Hash<String, String>, ...) retry(options = {})
Added in 0.6.0 Retry a single item.
-
- (Hash<String, String>, ...) shutdown
Shuts down SABnzbd.
-
- (Hash<String, String>, ...) switch(options = {})
Moving two items.
-
- (Hash<String, String>, ...) version
Get the version.
-
- (Hash<String, String>, ...) warnings
Current warnings.
Constructor Details
- (Api) initialize(caller = SabnzbdPlusModelApiCaller::HttpJson.new)
Set-up the Caller to use. Defaults to the HttpJson Caller
12 13 14 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 12 def initialize(caller = SabnzbdPlusModelApiCaller::HttpJson.new) @caller = caller end |
Instance Method Details
- (Hash<String, String>, ...) addid(options = {})
pp, script, cat and priority are all optional. This example will retrieve the newzbin post "33333" and instert it at low priority in the queue, assigned with a categoriy of "Example", to execute "customscript.cmd" once
finished, and with the unpacking option 3 (Repair, Unpack and Delete)
Added in 0.3 Priority added in 0.5
476 477 478 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 476 def addid( = {}) return @caller.call("addid", ) end |
- (Hash<String, String>, ...) addlocalfile(options = {})
Allows uploading of nzb/rar/zip/gz files by simply providing a local path (has to be accessable by the machine running SABnzbd
Added in 0.3 Priority added in 0.5
497 498 499 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 497 def addlocalfile( = {}) return @caller.call("addlocalfile", ) end |
- (Hash<String, String>, ...) addurl(options = {})
pp, script, cat and priority are all optional. This example adds the nzb into the queue marked as low priority, assigned with a categoriy of "Example", to execute "customscript.cmd" once finished, and with the unpacking option 3 (Repair, Unpack and Delete)
Allows full newzbin and nzbmatrix links (no need to parse out the ID).
Added in 0.3 Priority added in 0.5
453 454 455 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 453 def addurl( = {}) return @caller.call("addurl", ) end |
- (Hash<String, String>, ...) change_cat(options = {})
Added in 0.4
525 526 527 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 525 def change_cat( = {}) return @caller.call("change_cat", ) end |
- (Hash<String, String>, ...) change_opts(options = {})
Change value2 to control what post-processing option to use
Added in 0.5
Skip: 0 Repair: 1 Repair/Unpack: 2 Repair/Unpack/Delete: 3
546 547 548 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 546 def change_opts( = {}) return @caller.call("change_opts", ) end |
- (Hash<String, String>, ...) change_script(options = {})
Added in 0.4
511 512 513 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 511 def change_script( = {}) return @caller.call("change_script", ) end |
- (Hash<String, String>, ...) config(options = {})
Pauses for a set amount of time (value is the time in minutes to pause the queue)
Added in 0.5
Returns the new API Key
405 406 407 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 405 def config( = {}) return @caller.call("config", ) end |
- (Hash<String, String>, ...) get_cats
Current categories
Added in 0.4
323 324 325 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 323 def get_cats return @caller.call("get_cats", {}) end |
- (Hash<String, String>, ...) get_files(options = {})
Retrieve Contents of Queue item
Added in 0.5
561 562 563 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 561 def get_files( = {}) return @caller.call("get_files", ) end |
- (Hash<String, String>, ...) get_scripts
Return Scripts
Added in 0.4
334 335 336 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 334 def get_scripts return @caller.call("get_scripts", {}) end |
- (Hash<String, String>, ...) history(params = {})
A verbose output that as well as reporting items in the queue, will report on finished items being processed (verify/repaired/extracted) and other details such as categories, scripts.
Added in 0.5
Added in 0.3
281 282 283 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 281 def history(params = {}) return @caller.call("history", params) end |
- (Hash<String, String>, ...) pause
Pauses the whole queue (do not confuse this will pausing an individual download, this is a global pause)
Added in 0.3
381 382 383 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 381 def pause return @caller.call("pause", {}) end |
- (Hash<String, String>, ...) qstatus
Depreciated now by the advanced queue output, this is the old api that just provides limited details on the current queue and state of sabnzbd
Added in 0.3
41 42 43 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 41 def qstatus return @caller.call("qstatus", {}) end |
- (Hash<String, String>, ...) queue(options = {})
A verbose output that as well as reporting items in the queue, will report on finished items being processed (verify/repaired/extracted) and other details such as categories, scripts.
Added in 0.5
Added in 0.3
Added in 0.5
Low Priority: -1 Normal Priority: 0 High Priority: 1 Will return the new position in the queue if successful.
Changes the name of an item in the queue. The name is used for the final foldername, and input for any post-processing sorting, if used.
Added in 0.5
prefix script_ to the script name to execute
Added in 0.4
178 179 180 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 178 def queue( = {}) return @caller.call("queue", ) end |
- (Hash<String, String>, ...) restart
Restart SABnzbd
Added in 0.5
346 347 348 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 346 def restart return @caller.call("restart", {}) end |
- (Hash<String, String>, ...) resume
Resumes the whole queue (do not confuse this will resuming an individual download, this is a global resume)Resumes the whole queue (do not confuse this will resuming an individual download, this is a global resume)
Added in 0.3
416 417 418 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 416 def resume return @caller.call("resume", {}) end |
- (Hash<String, String>, ...) retry(options = {})
Added in 0.6.0 Retry a single item
575 576 577 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 575 def retry( = {}) return @caller.call("retry", ) end |
- (Hash<String, String>, ...) shutdown
Shuts down SABnzbd.
Added in 0.3
425 426 427 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 425 def shutdown return @caller.call("shutdown", {}) end |
- (Hash<String, String>, ...) switch(options = {})
Moving two items
0.5 - Will return the new position and priority (space separated, can be -1 if error occurs) "value" is the item you want to move, "value2" is the name of the item where you want to put value one above, shifting value2 down.
"value2" is the position in the queue where you wish to move the object. 0 is the top of the queue, 1 is the second item, etc..
371 372 373 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 371 def switch( = {}) return @caller.call("switch", ) end |
- (Hash<String, String>, ...) version
Get the version
Added in 0.4
292 293 294 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 292 def version return @caller.call("version", {}) end |
- (Hash<String, String>, ...) warnings
Current warnings
Added in 0.4
312 313 314 |
# File 'lib/sabnzbd_plus/model/api/api.rb', line 312 def warnings return @caller.call("warnings", {}) end |