Project

synowebapi

0.01
Low commit activity in last 3 years
A long-lived project that still receives updates
Ruby gem for Synology Web API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

SYNOWebAPI

Ruby gem for Synology Web API

Installation

$ gem install synowebapi

Synopsis

require 'synowebapi'

client = SYNOWebAPI::Client.new('http://192.168.10.10:5000')
client.connect(username: 'admin', password: 'password')

# Enable telnet service
# Check `cat /usr/syno/synoman/webapi/SYNO.Core.Terminal.lib | jq` for partial API info
client['SYNO.Core.Terminal'].request(method: 'set', enable_telnet: true)
# Yet another way to send the identical request above
client['SYNO.Core.Terminal'].set(enable_ssh: true)

# Show disks information.
# Check `cat /usr/syno/synoman/webapi/SYNO.Storage.CGI.lib | jq` for partial API info
resp = client['SYNO.Storage.CGI.Storage'].load_info
resp['disks'].each do |disk|
        puts "%-8s %-10s %-25s %-20s" % [disk['name'], disk['vendor'], disk['model'], disk['serial']]
end

# Download file from shared folder 'public'
# https://global.download.synology.com/download/Document/DeveloperGuide/Synology_File_Station_API_Guide.pdf
client['SYNO.FileStation.Download'].download('/any/test.jpg', {method: 'download', version: 2, path: '/public/file', mode: 'open'})

client.disconnect

Requirements

  • httpclient
  • faraday
  • faraday-middleware