Skip to content
Quentin Rousseau edited this page Jun 4, 2016 · 8 revisions

CLI

Commande selector

$ syno --help
  Usage: syno [options]

  Synology Rest API Command Line

  Options:

    -h, --help                       output usage information
    -c, --config <path>              DSM configuration file. Default to ~/.syno/config.yaml
    -u, --url <url>                  DSM URL. Default to https://admin:password@localhost:5001
    -p, --payload <payload>          JSON Payload
    -P, --pretty                     Prettyprint JSON Output
    -d, --debug                      Enabling Debugging Output
    -a, --api <version>              DSM API Version. Default to 6.0
    -i, --ignore-certificate-errors  Ignore certificate errors

  Commands:

    filestation|fs [options] <method>  DSM File Station API
    downloadstation|dl [options] <method>  DSM Download Station API
    audiostation|as [options] <method>  DSM Audio Station API

  Examples:

    $ syno filestation|fs getFileStationInfo
    $ syno downloadstation|dl getDownloadStationInfo
    $ syno audiostation|as getAudioStationInfo

DSM command

$ syno fs --help
  Usage: diskstationmanager|dsm [options] <method>

  DSM API

  Options:

    -h, --help                       output usage information
    -c, --config <path>              DSM configuration file. Default to ~/.syno/config.yaml
    -u, --url <url>                  DSM URL. Default to https://admin:password@localhost:5001
    -p, --payload <payload>          JSON Payload
    -P, --pretty                     Prettyprint JSON Output
    -d, --debug                      Enabling Debugging Output
    -a, --api <version>              DSM API Version. Default to 6.0
    -i, --ignore-certificate-errors  Ignore certificate errors

  Examples:

    $ syno diskstationmanager|dsm startFindme
    $ syno diskstationmanager|dsm getInfo --pretty'
    $ syno diskstationmanagercore|dsm listUsers
    $ syno diskstationmanagercore|dsm listPackages

File Station command

$ syno fs --help
  Usage: filestation|fs [options] <method>

  DSM File Station API

  Options:

    -h, --help                       output usage information
    -c, --config <path>              DSM configuration file. Default to ~/.syno/config.yaml
    -u, --url <url>                  DSM URL. Default to https://admin:password@localhost:5001
    -p, --payload <payload>          JSON Payload
    -P, --pretty                     Prettyprint JSON Output
    -d, --debug                      Enabling Debugging Output
    -a, --api <version>              DSM API Version. Default to 6.0
    -i, --ignore-certificate-errors  Ignore certificate errors

  Examples:

    $ syno filestation|fs listSharings
    $ syno filestation|fs list --pretty --payload '{"folder_path":"/path/to/folder"}'

Download Station command

$ syno dl --help
  Usage: downloadstation|dl [options] <method>

  DSM Download Station API

  Options:

    -h, --help                       output usage information
    -c, --config <path>              DSM configuration file. Default to ~/.syno/config.yaml
    -u, --url <url>                  DSM URL. Default to https://admin:password@localhost:5001
    -p, --payload <payload>          JSON Payload
    -P, --pretty                     Prettyprint JSON Output
    -d, --debug                      Enabling Debugging Output
    -a, --api <version>              DSM API Version. Default to 6.0
    -i, --ignore-certificate-errors  Ignore certificate errors

  Examples:

    $ syno downloadstation|dl createTask --payload '{"uri":"magnet|ed2k|ftp(s)|http(s)://link"}'
    $ syno downloadstation|dl listTasks
    $ syno downloadstation|dl listTasks --payload '{"limit":1}'
    $ syno downloadstation|dl getInfoTask --pretty --payload '{"id":"task_id"}'

Audio Station command

$ syno as --help
  Usage: audiostation|as [options] <method>

  DSM Audio Station API

  Options:

    -h, --help                       output usage information
    -c, --config <path>              DSM configuration file. Default to ~/.syno/config.yaml
    -u, --url <url>                  DSM URL. Default to https://admin:password@localhost:5001
    -p, --payload <payload>          JSON Payload
    -P, --pretty                     Prettyprint JSON Output
    -d, --debug                      Enabling Debugging Output
    -a, --api <version>              DSM API Version. Default to 6.0
    -i, --ignore-certificate-errors  Ignore certificate errors

  Examples:

    $ syno audiostation|as listSongs --payload '{"limit":1}'
    $ syno audiostation|as listAlbums
    $ syno audiostation|as searchSong --payload '{"title":"victoria"}'

Examples

Without a configuration file

$ syno fs getInfo --url https://admin:synology@demo.synology.com:5001 --pretty

With a configuration file

# Example config file, by default it should be located at:
# ~/.syno/config.yaml

url:
  protocol: https
  host: localhost
  port: 5001
  account: admin
  passwd: password
$ syno fs geInfo --pretty