Giter Site home page Giter Site logo

dsm_api's Introduction

将本项目可以搭建在任何有网络的地方上,使用RESTful API调用群晖nas接口,可用于开发前端项目,也可用于定制自己专属的管理系统,本项目持续更新中"

注意事项

  • 填写好config.js文件

  • node.js版本大于或等于14

    根据测试,群晖7.1.1系统可以正常使用,理论上其他版本也能使用,如有问题请创建issue

使用教程

群晖 :确保已安装npm和node.js,在群晖管理页面创建好文件夹,将项目里所有文件上传,通过ssh进入到该文件夹,运行下方命令

windows:安装node.js后,通过powershell打开该项目,运行命令

linux:都用linux了,不用我多说了吧(手动狗头),安装好node环境和npm,运行命令即可

$ npm install
$ npm run dsm // 运行项目
$ npm run stop // 停止项目

关于返回结果的问题

状态码 解答
102 返回个状态码一般是未安装该应用导致的

在运行其他api之前先进行登录,本项目采用中间件封装形式,通过调用以下api即可操作群晖系统

示例 http://romain:port/user/login?username=dsm&password=123456

romain为域名

port为端口

/api 简介

all 获取所有群晖api接口

/user 简介

/login 登录

参数名称 是否必填 接口类型 说明
username true string 群晖登录用户名
password true string 群晖登录密码

/logout 退出

参数名称 是否必填 接口类型 说明

/system 简介

/info 获取系统基本信息

参数名称 是否必填 接口类型 说明

/status 获取系统状态

参数名称 是否必填 接口类型 说明

/network 获取网络信息

参数名称 是否必填 接口类型 说明

/service 获取已启用的服务

参数名称 是否必填 接口类型 说明

/terminal 终端设置

参数名称 是否必填 接口类型 说明
enablessh false boolean 开启或关闭ssh,不填则不更改
enabletelnet false boolean 开启或关闭telnet,不填则不更改
sshport false boolean ssh端口,不填则不更改

/shutdown 关机

参数名称 是否必填 接口类型 说明
force false boolean true则为强制关机,默认false

/reboot 重启

参数名称 是否必填 接口类型 说明
force false boolean true则为强制重启,默认false

/cloudsync 简介

/list 获取cloudsync所有已授权的云盘

参数名称 是否必填 接口类型 说明

/settingmsg 获取云盘设置信息

参数名称 是否必填 接口类型 说明
id true number 网盘的对应id,在list里获取

/status 获取云盘状态信息

参数名称 是否必填 接口类型 说明
id true number 网盘的对应id,在list里获取

/property 获取云盘属性信息

参数名称 是否必填 接口类型 说明
id true number 网盘的对应id,在list里获取

/log 同步记录

参数名称 是否必填 接口类型 说明
id true number 网盘的对应id,在list里获取
limit false number 一次性获取多少数据,默认为200条

/change 更改云盘同步设置

参数名称 是否必填 接口类型 说明
id true number 网盘的对应id,在list里获取
name true string cloudsync里显示的名称
Pollingtime true number 轮询时间
maxdownloadspeed true number 最大下载速度,0为不限速
maxuploadspeed true number 最大上传速度,0为不限速

/pause 暂停同步所有云盘

参数名称 是否必填 接口类型 说明

/start 开始同步

参数名称 是否必填 接口类型 说明

dsm_api's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.