Skip to content

Commit a511676

Browse files
committed
添加接口文档:暴露 /disk/list
1 parent 3277a1f commit a511676

File tree

1 file changed

+229
-1
lines changed

1 file changed

+229
-1
lines changed

API.md

Lines changed: 229 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,241 @@ GET
229229
}
230230
```
231231

232+
## 磁盘列表
233+
mountpoint 参数为 根据传参目录磁盘使用情况 使用目录
234+
### 地址:
235+
> ip:port/disk/list
236+
237+
### 请求方法:
238+
GET
239+
240+
### 返回参数:
241+
linux 返回案例:
242+
```javascript
243+
[
244+
{
245+
"device": "sysfs",
246+
"mountpoint": "/sys",
247+
"fstype": "sysfs",
248+
"opts": "rw,nosuid,nodev,noexec,relatime"
249+
},
250+
{
251+
"device": "proc",
252+
"mountpoint": "/proc",
253+
"fstype": "proc",
254+
"opts": "rw,nosuid,nodev,noexec,relatime"
255+
},
256+
{
257+
"device": "udev",
258+
"mountpoint": "/dev",
259+
"fstype": "devtmpfs",
260+
"opts": "rw,nosuid,relatime,size=4066816k,nr_inodes=1016704,mode=755"
261+
},
262+
{
263+
"device": "devpts",
264+
"mountpoint": "/dev/pts",
265+
"fstype": "devpts",
266+
"opts": "rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000"
267+
},
268+
{
269+
"device": "tmpfs",
270+
"mountpoint": "/run",
271+
"fstype": "tmpfs",
272+
"opts": "rw,nosuid,noexec,relatime,size=817136k,mode=755"
273+
},
274+
{
275+
"device": "/dev/mapper/ubuntu--134--vg-root",
276+
"mountpoint": "/",
277+
"fstype": "ext4",
278+
"opts": "rw,relatime,errors=remount-ro,data=ordered"
279+
},
280+
{
281+
"device": "securityfs",
282+
"mountpoint": "/sys/kernel/security",
283+
"fstype": "securityfs",
284+
"opts": "rw,nosuid,nodev,noexec,relatime"
285+
},
286+
{
287+
"device": "tmpfs",
288+
"mountpoint": "/dev/shm",
289+
"fstype": "tmpfs",
290+
"opts": "rw,nosuid,nodev"
291+
},
292+
{
293+
"device": "tmpfs",
294+
"mountpoint": "/run/lock",
295+
"fstype": "tmpfs",
296+
"opts": "rw,nosuid,nodev,noexec,relatime,size=5120k"
297+
},
298+
{
299+
"device": "tmpfs",
300+
"mountpoint": "/sys/fs/cgroup",
301+
"fstype": "tmpfs",
302+
"opts": "rw,mode=755"
303+
},
304+
{
305+
"device": "cgroup",
306+
"mountpoint": "/sys/fs/cgroup/systemd",
307+
"fstype": "cgroup",
308+
"opts": "rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd"
309+
},
310+
{
311+
"device": "pstore",
312+
"mountpoint": "/sys/fs/pstore",
313+
"fstype": "pstore",
314+
"opts": "rw,nosuid,nodev,noexec,relatime"
315+
},
316+
{
317+
"device": "cgroup",
318+
"mountpoint": "/sys/fs/cgroup/perf_event",
319+
"fstype": "cgroup",
320+
"opts": "rw,nosuid,nodev,noexec,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event"
321+
},
322+
{
323+
"device": "cgroup",
324+
"mountpoint": "/sys/fs/cgroup/cpuset",
325+
"fstype": "cgroup",
326+
"opts": "rw,nosuid,nodev,noexec,relatime,cpuset,clone_children"
327+
},
328+
{
329+
"device": "cgroup",
330+
"mountpoint": "/sys/fs/cgroup/blkio",
331+
"fstype": "cgroup",
332+
"opts": "rw,nosuid,nodev,noexec,relatime,blkio"
333+
},
334+
{
335+
"device": "cgroup",
336+
"mountpoint": "/sys/fs/cgroup/pids",
337+
"fstype": "cgroup",
338+
"opts": "rw,nosuid,nodev,noexec,relatime,pids,release_agent=/run/cgmanager/agents/cgm-release-agent.pids"
339+
},
340+
{
341+
"device": "cgroup",
342+
"mountpoint": "/sys/fs/cgroup/cpu,cpuacct",
343+
"fstype": "cgroup",
344+
"opts": "rw,nosuid,nodev,noexec,relatime,cpu,cpuacct"
345+
},
346+
{
347+
"device": "cgroup",
348+
"mountpoint": "/sys/fs/cgroup/hugetlb",
349+
"fstype": "cgroup",
350+
"opts": "rw,nosuid,nodev,noexec,relatime,hugetlb,release_agent=/run/cgmanager/agents/cgm-release-agent.hugetlb"
351+
},
352+
{
353+
"device": "cgroup",
354+
"mountpoint": "/sys/fs/cgroup/memory",
355+
"fstype": "cgroup",
356+
"opts": "rw,nosuid,nodev,noexec,relatime,memory"
357+
},
358+
{
359+
"device": "cgroup",
360+
"mountpoint": "/sys/fs/cgroup/freezer",
361+
"fstype": "cgroup",
362+
"opts": "rw,nosuid,nodev,noexec,relatime,freezer"
363+
},
364+
{
365+
"device": "cgroup",
366+
"mountpoint": "/sys/fs/cgroup/net_cls,net_prio",
367+
"fstype": "cgroup",
368+
"opts": "rw,nosuid,nodev,noexec,relatime,net_cls,net_prio"
369+
},
370+
{
371+
"device": "cgroup",
372+
"mountpoint": "/sys/fs/cgroup/devices",
373+
"fstype": "cgroup",
374+
"opts": "rw,nosuid,nodev,noexec,relatime,devices"
375+
},
376+
{
377+
"device": "systemd-1",
378+
"mountpoint": "/proc/sys/fs/binfmt_misc",
379+
"fstype": "autofs",
380+
"opts": "rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct"
381+
},
382+
{
383+
"device": "debugfs",
384+
"mountpoint": "/sys/kernel/debug",
385+
"fstype": "debugfs",
386+
"opts": "rw,relatime"
387+
},
388+
{
389+
"device": "mqueue",
390+
"mountpoint": "/dev/mqueue",
391+
"fstype": "mqueue",
392+
"opts": "rw,relatime"
393+
},
394+
{
395+
"device": "hugetlbfs",
396+
"mountpoint": "/dev/hugepages",
397+
"fstype": "hugetlbfs",
398+
"opts": "rw,relatime"
399+
},
400+
{
401+
"device": "sunrpc",
402+
"mountpoint": "/run/rpc_pipefs",
403+
"fstype": "rpc_pipefs",
404+
"opts": "rw,relatime"
405+
},
406+
{
407+
"device": "fusectl",
408+
"mountpoint": "/sys/fs/fuse/connections",
409+
"fstype": "fusectl",
410+
"opts": "rw,relatime"
411+
},
412+
{
413+
"device": "/dev/sda1",
414+
"mountpoint": "/boot",
415+
"fstype": "ext2",
416+
"opts": "rw,relatime,block_validity,barrier,user_xattr,acl"
417+
},
418+
{
419+
"device": "cgmfs",
420+
"mountpoint": "/run/cgmanager/fs",
421+
"fstype": "tmpfs",
422+
"opts": "rw,relatime,size=100k,mode=755"
423+
},
424+
{
425+
"device": "tmpfs",
426+
"mountpoint": "/run/user/0",
427+
"fstype": "tmpfs",
428+
"opts": "rw,nosuid,nodev,relatime,size=817136k,mode=700"
429+
},
430+
{
431+
"device": "172.16.136.143:/exports/10000sq",
432+
"mountpoint": "/data/file",
433+
"fstype": "nfs",
434+
"opts": "rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.16.136.143,mountvers=3,mountport=597,mountproto=udp,local_lock=none,addr=172.16.136.143"
435+
}
436+
]
437+
```
438+
439+
window 返回案例:
440+
```javascript
441+
[
442+
{
443+
"device": "C:",
444+
"mountpoint": "C:",
445+
"fstype": "NTFS",
446+
"opts": "rw.compress"
447+
},
448+
{
449+
"device": "E:",
450+
"mountpoint": "E:",
451+
"fstype": "NTFS",
452+
"opts": "rw.compress"
453+
}
454+
]
455+
```
456+
232457
## 根据传参目录磁盘使用情况
233458
### 地址:
234459
> ip:port/disk/path
235460
236461
### 请求方法:
237462
POST
238463

464+
### 参数说明:
465+
path : 目录地址,参数案例 /data/file
466+
239467
### 返回参数:
240468
```javascript
241469
{
@@ -250,4 +478,4 @@ POST
250478
"inodesFree": 826168530,
251479
"inodesUsedPercent": 0.11721223745390395
252480
}
253-
```
481+
```

0 commit comments

Comments
 (0)