diff options
author | Canop <cano.petrole@gmail.com> | 2022-02-27 19:14:09 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-02-27 19:14:09 +0100 |
commit | f44428a61dd750b6e5e8b257a27b788272a0694b (patch) | |
tree | 56bfbf3230e88ad8b92f2de8473b2ae83e4ffcd3 | |
parent | 9d49c5b643caa8b279399177da44b293a9a44128 (diff) |
update the JSON exemple in website
-rw-r--r-- | website/docs/json.md | 116 |
1 files changed, 45 insertions, 71 deletions
diff --git a/website/docs/json.md b/website/docs/json.md index 280c10c..33a65fc 100644 --- a/website/docs/json.md +++ b/website/docs/json.md @@ -1,85 +1,59 @@ With `lfs --json` (shortened in `lfs -j`) you get a JSON structure that can be used in other programs. -# Raw output +# JSON output -Here's a sample, that I could get with `lfs -j > disks.json`: +The normal output is an array of all filesystem matching the filter. + +In order to make a sample fitting this site, I extracted the first filesystem with + +```bash +lfs -j | jq '.[0]' > disk.json +``` + +Here it is: ```JSON -[ - { - "bound": false, - "dev": { - "major": 8, - "minor": 1 - }, - "disk": { - "crypted": false, - "ram": false, - "removable": false, - "rotational": false, - "type": "SSD" - }, - "fs": "/dev/sda1", - "fs-label": null, - "fs-type": "ext4", - "id": 26, - "mount-point": "/", - "stats": { - "available": "81G", - "bavail": 19668017, - "bfree": 22694346, - "blocks": 59233748, - "bsize": 4096, - "inodes": { - "avail": 13901150, - "files": 15114240, - "free": 13901150, - "used-percent": "8%" - }, - "size": "243G", - "used": "162G", - "used-percent": "67%" - } +{ + "bound": false, + "dev": { + "major": 8, + "minor": 1 }, - { - "bound": false, - "dev": { - "major": 8, - "minor": 17 - }, - "disk": { - "crypted": false, - "ram": false, - "removable": false, - "rotational": false, - "type": "SSD" + "disk": { + "crypted": false, + "ram": false, + "removable": false, + "rotational": false, + "type": "SSD" + }, + "fs": "/dev/sda1", + "fs-label": null, + "fs-type": "ext4", + "id": 26, + "mount-point": "/", + "remote": false, + "stats": { + "available": "82G", + "bavail": 19918995, + "bfree": 22945324, + "blocks": 59233748, + "bsize": 4096, + "inodes": { + "avail": 13875011, + "files": 15114240, + "free": 13875011, + "used-percent": "8%" }, - "fs": "/dev/sdb1", - "fs-label": null, - "fs-type": "xfs", - "id": 106, - "mount-point": "/home/dys/dev", - "stats": { - "available": "558G", - "bavail": 136303656, - "bfree": 136303656, - "blocks": 244071157, - "bsize": 4096, - "inodes": { - "avail": 487292182, - "files": 488380736, - "free": 487292182, - "used-percent": "0%" - }, - "size": "1.0T", - "used": "441G", - "used-percent": "44%" - } + "size": "243G", + "used": "161G", + "used-percent": "66%" } -] +} ``` +The `disk`, `stats`, and `stats.inodes` structures, or the `fs-label`, may be `null` for some filesystems. + # All filesystems As for the table view, the JSON is by default limited to "normal" storage devices. |