kwent / syno

Simple Node.js wrapper and CLI for Synology DSM REST API 5.x and 6.x.
http://kwent.github.io/syno
MIT License
318 stars 51 forks source link

Shutdown the DiskStation via Node #30

Open pdiegmann opened 7 years ago

pdiegmann commented 7 years ago

Hi,

I'm looking for a way to shutdown the disk station as found here: https://github.com/kwent/syno/blob/master/definitions/DSM/6.0/7321/SYNO.Core.System.lib#L1 How can I invoke this method? syno.dsm.shutdown() does not work and the cli doesn't recognize syno dsm shutdown either:

node_modules/syno/bin/syno.js:55 return syno[api][cmd](payload, function(err, data) { ^

TypeError: syno[api][cmd] is not a function at execute (node_modules/syno/bin/syno.js:55:24) at Command. (node_modules/syno/bin/syno.js:256:10) at Command.listener (node_modules/syno/node_modules/commander/index.js:301:8) at emitTwo (events.js:106:13) at Command.emit (events.js:191:7) at Command.parseArgs (node_modules/syno/node_modules/commander/index.js:615:12) at Command.parse (node_modules/syno/node_modules/commander/index.js:458:21) at Object. (node_modules/syno/bin/syno.js:347:9) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10)

Any help is greatly appreciated.

kwent commented 7 years ago

Hi @pdiegmann,

You are right for some reason, their last API version does not provide reboot/shutdown methods (https://github.com/kwent/syno/blob/master/definitions/6.x/_full.json#L14964)... I tried in the UI and they are using API version 1.

The system is configured to use the last API version (3 in our case), that's why those methods are not available.

I'll will have to revisit this logic and release a new version of this package to fix this issue.

I'll keep you updated.

autofrank commented 5 years ago

Hi @kwent

Any update on this ?

Thanks

instalator commented 4 years ago

https://github.com/kwent/syno/pull/52