コード例 #1
0
        public GetFileSystemEntriesResponse GetFileSystemEntries(string folderPath, int?offset = null,
                                                                 int?limit      = null, SortBy sortBy = SortBy.ctime, SortDirection sortDirection     = SortDirection.asc,
                                                                 string pattern = null, FileTypeFilter fileType = FileTypeFilter.all, string gotoPath = null,
                                                                 FileListAddtionalOptions additional = null)
        {
            dynamic requiredParams = new
            {
                api         = "SYNO.FileStation.List",
                version     = 1,
                method      = "list",
                folder_path = folderPath,
                offset,
                limit,
                sort_by        = sortBy,
                sort_direction = sortDirection,
                pattern,
                filetype  = fileType,
                goto_path = gotoPath
            };

            var proc = new FuncProcessor <GetFileSystemEntriesResponse>("/entry.cgi", _session.sid,
                                                                        requiredParams, new
            {
                additional = TrueBooleanValuesFromObjectToCommaSeparatedList(additional)
            });

            return(proc.Run());
        }
コード例 #2
0
        public SearchStatusResponse SearchStatus(string taskId, int?offset = null, int?limit = 100,
                                                 SortBy sortBy             = SortBy.name, SortDirection sortDirection = SortDirection.asc, string[] pattern = null,
                                                 FileTypeFilter fileType   = FileTypeFilter.file, FileSearchListAddtionalOptions additional = null)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Search",
                version = 1,
                method  = "list",
                taskid  = taskId,
                offset,
                limit,
                sort_by        = sortBy,
                sort_direction = sortDirection,
                pattern        = string.Join(",", pattern ?? new[] { "" }),
                filetype       = fileType
            };

            var proc = new FuncProcessor <SearchStatusResponse>("/entry.cgi", _session.sid,
                                                                requiredParams, new
            {
                additional = TrueBooleanValuesFromObjectToCommaSeparatedList(additional)
            });

            return(proc.Run());
        }
コード例 #3
0
        public SearchStartResponse SearchStartAsync(string folderPath, bool recursive = true,
                                                    string[] globPatterns             = null, string[] extentionPatterns       = null,
                                                    FileTypeFilter fileType           = FileTypeFilter.file, long minSizeBytes = 0, long maxSizeBytes            = long.MaxValue,
                                                    DateTime?modifiedTimeFrom         = null, DateTime?modifiedTimeTo          = null, DateTime?createdTimeFrom  = null,
                                                    DateTime?createdTimeTo            = null, DateTime?accessedTimeTo          = null, DateTime?accessedTimeFrom = null,
                                                    string owner = null, string group = null)
        {
            dynamic requiredParams = new
            {
                api         = "SYNO.FileStation.Search",
                version     = 1,
                method      = "start",
                folder_path = folderPath,
                recursive,
                pattern     = string.Join(",", globPatterns ?? new[] { "" }),
                extension   = string.Join(",", extentionPatterns ?? new[] { "" }),
                filetype    = fileType,
                size_from   = minSizeBytes,
                size_to     = maxSizeBytes,
                mtime_from  = modifiedTimeFrom,
                mtime_to    = modifiedTimeTo,
                crtime_from = createdTimeFrom,
                crtime_to   = createdTimeTo,
                atime_from  = accessedTimeFrom,
                atiime_to   = accessedTimeTo,
                owner,
                group
            };

            var proc = new FuncProcessor <SearchStartResponse>("/entry.cgi", _session.sid, requiredParams);

            return(proc.Run());
        }
コード例 #4
0
        public GetDiskstationInfoResponse GetDiskstationInfo()
        {
            var proc = new FuncProcessor <GetDiskstationInfoResponse>("/entry.cgi", _session.sid, new
            {
                api     = "SYNO.FileStation.Info",
                version = 2,
                method  = "get"
            });

            return(proc.Run());
        }
コード例 #5
0
        public SearchCleanResponse SearchClean(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Search",
                version = 1,
                method  = "clean",
                taskid  = taskId
            };

            var proc = new FuncProcessor <SearchCleanResponse>("/entry.cgi", _session.sid, requiredParams);

            return(proc.Run());
        }
コード例 #6
0
ファイル: SynologyApi.cs プロジェクト: cyanlycan/Synology.NET
        public SearchStopResponse SearchStop(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Search",
                version = 1,
                method  = "stop",
                taskid  = taskId
            };

            var proc = new FuncProcessor <SearchStopResponse>("/FileStation/file_find.cgi", _session.sid, requiredParams);

            return(proc.Run());
        }
コード例 #7
0
        public DeleteFavoriteResponse DeleteFavorite(string path)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Favorite",
                version = 1,
                method  = "delete",
                path
            };

            var proc = new FuncProcessor <DeleteFavoriteResponse>("/entry.cgi", _session.sid,
                                                                  requiredParams);

            return(proc.Run());
        }
コード例 #8
0
ファイル: SynologyApi.cs プロジェクト: cyanlycan/Synology.NET
        public CopyMoveStopResponse CopyMoveStop(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.CopyMove",
                version = 1,
                method  = "stop",
                taskid  = taskId
            };

            var proc = new FuncProcessor <CopyMoveStopResponse>("/FileStation/file_MVCP.cgi", _session.sid,
                                                                requiredParams);

            return(proc.Run());
        }
コード例 #9
0
ファイル: SynologyApi.cs プロジェクト: cyanlycan/Synology.NET
        public GetFileMd5StopResponse GetFileMd5Stop(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.MD5",
                version = 1,
                method  = "stop",
                taskid  = taskId
            };

            var proc = new FuncProcessor <GetFileMd5StopResponse>("/FileStation/file_md5.cgi", _session.sid,
                                                                  requiredParams);

            return(proc.Run());
        }
コード例 #10
0
ファイル: SynologyApi.cs プロジェクト: cyanlycan/Synology.NET
        public DirSizeStopResponse GetDirectorySizeStop(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.DirSize",
                version = 1,
                method  = "stop",
                taskid  = taskId
            };

            var proc = new FuncProcessor <DirSizeStopResponse>("/FileStation/file_dirSize.cgi", _session.sid,
                                                               requiredParams);

            return(proc.Run());
        }
コード例 #11
0
ファイル: SynologyApi.cs プロジェクト: cyanlycan/Synology.NET
        public CompressStatusResponse CompressStatus(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Compress",
                version = 1,
                method  = "status",
                taskid  = taskId
            };

            var proc = new FuncProcessor <CompressStatusResponse>("/FileStation/file_compress.cgi", _session.sid,
                                                                  requiredParams);

            return(proc.Run());
        }
コード例 #12
0
        public ClearFinishedBackgroundTasksResponse ClearFinishedBackgroundTasks(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.BackgroundTask",
                version = 1,
                method  = "clear_finished",
                taskid  = taskId
            };

            var proc = new FuncProcessor <ClearFinishedBackgroundTasksResponse>("/entry.cgi",
                                                                                _session.sid, requiredParams);

            return(proc.Run());
        }
コード例 #13
0
        public DeleteShareResponse DeleteShare(string id)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Sharing",
                version = 1,
                method  = "delete",
                id
            };

            var proc = new FuncProcessor <DeleteShareResponse>("/entry.cgi", _session.sid,
                                                               requiredParams);

            return(proc.Run());
        }
コード例 #14
0
        public GetDirectorySizeAsyncResponse GetDirectorySizeAsync(string path)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.DirSize",
                version = 1,
                method  = "start",
                path
            };

            var proc = new FuncProcessor <GetDirectorySizeAsyncResponse>("/entry.cgi", _session.sid,
                                                                         requiredParams);

            return(proc.Run());
        }
コード例 #15
0
        public DeleteStatusResponse DeleteStatus(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Delete",
                version = 2,
                method  = "status",
                taskid  = taskId
            };

            var proc = new FuncProcessor <DeleteStatusResponse>("/entry.cgi", _session.sid,
                                                                requiredParams);

            return(proc.Run());
        }
コード例 #16
0
        public ExtractStopResponse ExtractStop(string taskId)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Extract",
                version = 1,
                method  = "stop",
                taskid  = taskId
            };

            var proc = new FuncProcessor <ExtractStopResponse>("/entry.cgi", _session.sid,
                                                               requiredParams);

            return(proc.Run());
        }
コード例 #17
0
        public GetSharingInfoResponse GetSharingInfo(string id)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Sharing",
                version = 3,
                method  = "getinfo",
                id
            };

            var proc = new FuncProcessor <GetSharingInfoResponse>("/entry.cgi", _session.sid,
                                                                  requiredParams);

            return(proc.Run());
        }
コード例 #18
0
        public ClearInvalidSharesResponse ClearInvalidShares(string id)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Sharing",
                version = 1,
                method  = "clear_invalid",
                id
            };

            var proc = new FuncProcessor <ClearInvalidSharesResponse>("/entry.cgi", _session.sid,
                                                                      requiredParams);

            return(proc.Run());
        }
コード例 #19
0
        public GetFileMd5AsyncResponse GetFileMd5Async(string filePath)
        {
            dynamic requiredParams = new
            {
                api       = "SYNO.FileStation.MD5",
                version   = 1,
                method    = "start",
                file_path = filePath
            };

            var proc = new FuncProcessor <GetFileMd5AsyncResponse>("/entry.cgi", _session.sid,
                                                                   requiredParams);

            return(proc.Run());
        }
コード例 #20
0
        public ClearBrokenFavoritesResponse ClearBrokenFavorites(string path, string name)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Favorite",
                version = 1,
                method  = "clear_broken",
                path,
                name
            };

            var proc = new FuncProcessor <ClearBrokenFavoritesResponse>("/entry.cgi", _session.sid,
                                                                        requiredParams);

            return(proc.Run());
        }
コード例 #21
0
        public DeleteResponse Delete(string path, bool?recursive = false, string searchTaskId = null)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Delete",
                version = 2,
                method  = "delete",
                path    = "\"" + path + "\"",
                recursive,
                search_taskid = searchTaskId
            };

            var proc = new FuncProcessor <DeleteResponse>("/entry.cgi", _session.sid, requiredParams);

            return(proc.Run());
        }
コード例 #22
0
        public ReplaceFavoriteResponse ReplaceFavorite(string path, string name)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Favorite",
                version = 1,
                method  = "replace_all",
                path,
                name
            };

            var proc = new FuncProcessor <ReplaceFavoriteResponse>("/entry.cgi", _session.sid,
                                                                   requiredParams);

            return(proc.Run());
        }
コード例 #23
0
        public RawSynologyResponse CheckWritePermission(string path, bool?createOnly = true)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.CheckPermission",
                version = 1,
                method  = "write",
                path,
                create_only = createOnly
            };

            var proc = new FuncProcessor <RawSynologyResponse>("/entry.cgi", _session.sid,
                                                               requiredParams);

            return(proc.Run());
        }
コード例 #24
0
ファイル: SynologyApi.cs プロジェクト: cyanlycan/Synology.NET
        public EditFavoriteResponse EditFavorite(string path, string name)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Favorite",
                version = 1,
                method  = "edit",
                path,
                name
            };

            var proc = new FuncProcessor <EditFavoriteResponse>("/FileStation/file_favorite.cgi", _session.sid,
                                                                requiredParams);

            return(proc.Run());
        }
コード例 #25
0
        public AddFavoriteResponse AddFavorite(string path, string name, int index = -1)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Favorite",
                version = 1,
                method  = "add",
                path,
                name
            };

            var proc = new FuncProcessor <AddFavoriteResponse>("/entry.cgi", _session.sid,
                                                               requiredParams);

            return(proc.Run());
        }
コード例 #26
0
        public GetFileSystemInfoResponse GetFileSystemInfo(string[] paths, FileGetInfoAddtionalOptions additional = null)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.List",
                version = 1,
                method  = "getinfo",
                path    = string.Join(",", paths)
            };

            var proc = new FuncProcessor <GetFileSystemInfoResponse>("/entry.cgi", _session.sid,
                                                                     requiredParams, new
            {
                additional = TrueBooleanValuesFromObjectToCommaSeparatedList(additional)
            });

            return(proc.Run());
        }
コード例 #27
0
        public AddShareResponse AddShare(string path, string password = null, DateTime?dateExpires = null,
                                         DateTime?dateAvailable       = null)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Sharing",
                version = 3,
                method  = "create",
                path,
                password,
                date_expired   = dateExpires.HasValue ? dateExpires.Value.ToString("yyyy-MM-dd") : "0",
                date_available = dateAvailable.HasValue ? dateAvailable.Value.ToString("yyyy-MM-dd") : "0"
            };

            var proc = new FuncProcessor <AddShareResponse>("/entry.cgi", _session.sid, requiredParams);

            return(proc.Run());
        }
コード例 #28
0
ファイル: SynologyApi.cs プロジェクト: cyanlycan/Synology.NET
        public EditShareResponse EditShare(string id, string password = null, DateTime?dateExpires = null,
                                           DateTime?dateAvailable     = null)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Sharing",
                version = 1,
                method  = "edit",
                id,
                password,
                date_expired   = dateExpires.HasValue ? dateExpires.Value.ToString("yyyy-MM-dd") : "0",
                date_available = dateAvailable.HasValue ? dateAvailable.Value.ToString("yyyy-MM-dd") : "0"
            };

            var proc = new FuncProcessor <EditShareResponse>("/FileStation/file_sharing.cgi", _session.sid,
                                                             requiredParams);

            return(proc.Run());
        }
コード例 #29
0
        public DeleteAsyncResponse DeleteAsync(string path, bool?accurateProgress = true, bool?recursive = true,
                                               string searchTaskId = null)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Delete",
                version = 2,
                method  = "start",
                path,
                accurate_progress = accurateProgress,
                recursive,
                search_taskid = searchTaskId
            };

            var proc = new FuncProcessor <DeleteAsyncResponse>("/entry.cgi", _session.sid,
                                                               requiredParams);

            return(proc.Run());
        }
コード例 #30
0
        public GetUserSharesResponse GetUserShares(int?offset, int?limit, SharingSortBy sortBy,
                                                   SortDirection sortDirection = SortDirection.asc, bool?forceClean = true)
        {
            dynamic requiredParams = new
            {
                api     = "SYNO.FileStation.Sharing",
                version = 1,
                method  = "list",
                offset,
                limit,
                sort_by        = sortBy,
                sort_direction = sortDirection,
                force_clean    = forceClean
            };

            var proc = new FuncProcessor <GetUserSharesResponse>("/entry.cgi", _session.sid,
                                                                 requiredParams);

            return(proc.Run());
        }