-
Notifications
You must be signed in to change notification settings - Fork 13
synology fileStation
Yannick Croissant edited this page Aug 16, 2013
·
2 revisions
?????
?????
?????
?????
?????
?????
?????
?????
?????
?????
?????
GET /webapi/FileStation/file_share.cgi
List a folder
Parameter | Mandatory | Default value | Description |
---|---|---|---|
api |
Y | Method ID: SYNO.FileStation.List
|
|
version |
Y | Version of the api to use. Possible values: 1 . |
|
method |
Y | Method to use. Possibles values: list_share , list
|
|
node |
(?) Possible values: fm_root
|
||
action |
list |
Action to perform. Possible values: list . |
|
additional |
Additional informations to retrieve, concatenated by , . Possibles values: real_path , size , owner , time , perm , type and mount_point_type . |
||
filetype |
all |
Filetype filter. Possible values: dir , file and all
|
|
pattern |
Pattern for file filtering (wildcards allowed) | ||
folder_path |
/home |
Absolute path of the folder to list. | |
limit |
1000 |
Maximum number of files to return. | |
offset |
0 |
Offset where to start the listing. | |
sort_by |
name |
Field used to order the files. Possible values: name , size , type , user , mtime , crtime , atime , privilege_str and group . |
|
sort_direction |
ASC |
Set to ASC for an ascending order or to DESC for a descending one |
NOTE: When listing the root directory, method
is set to list_share
and node
is set to fm_root
. In other cases method
is set to list
and node
is not set.
var Synology = require('synology');
var syno = new Synology();
syno.query({
path: '/webapi/FileStation/file_share.cgi',
params: {
api: 'SYNO.FileStation.List',
version: 1,
method: 'list',
folder_path: '/web',
additional: 'real_path,size',
pattern: '*module*'
}
}, function(err, data) {
if (err) throw err;
console.log(data);
});
{
"data": {
"files": [
{
"additional": {
"real_path": "/volume1/web/node_modules",
"size": "4096"
},
"isdir": true,
"name": "node_modules",
"path": "/web/node_modules"
},
{
"additional": {
"real_path": "/volume1/web/module.js",
"size": "14251"
},
"isdir": false,
"name": "module.js",
"path": "/web/module.js"
}
],
"offset": 0,
"total": 2
},
"success": true
}
?????
?????
?????
GET /webapi/FileStation/file_sharing.cgi
Create or delete a shareable link for a file or a directory
Parameter | Mandatory | Default value | Description |
---|---|---|---|
api |
Y | Method ID: SYNO.FileStation.Sharing
|
|
version |
Y | Version of the api to use. Possible values: 1 . |
|
method |
Y | Method to use. Possibles values: create , delete
|
|
path |
Y | File or directory to share. |
var Synology = require('synology');
var syno = new Synology();
syno.query({
path: '/webapi/FileStation/file_share.cgi',
params: {
api: 'SYNO.FileStation.Sharing',
version: 1,
method: 'create',
path: '/home/foo/bar.txt'
}
}, function(err, data) {
if (err) throw err;
console.log(data);
});
{
"data": {
"links": [{
"error": 0,
"id": "hLjd88BO",
"path": "/home/foo/bar.txt",
"qrcode": "iVBORw0KGgoAA..."
}]
},
"success": true
}
?????
POST /webapi/FileStation/api_upload.cgi
Upload a file
Parameter | Mandatory | Default value | Description |
---|---|---|---|
api |
Y | Method ID: SYNO.FileStation.Upload
|
|
version |
Y | Version of the api to use. Possible values: 1 . |
|
method |
Y | Method to use. Possibles values: upload
|
|
file |
Y | File to upload (Stream). | |
overwrite |
Y | Overwrite the file if it already exists. | |
create_parents |
Y | Automatically create the parents directories if needed. | |
dest_folder_path |
Y | Destination folder |