diff options
author | nicolargo <nicolashennion@gmail.com> | 2024-05-07 11:49:55 +0200 |
---|---|---|
committer | nicolargo <nicolashennion@gmail.com> | 2024-05-07 11:49:55 +0200 |
commit | e8563a0fc4b0c0663f354deb0b846421f94a9f95 (patch) | |
tree | 1f6c2efc53599b91a41449554d2693483a56263b | |
parent | 6e95892e417726198530c3ecb126b197fdfd1a6a (diff) |
Format code and update docs/webui
88 files changed, 417 insertions, 563 deletions
@@ -66,13 +66,13 @@ test: ## Run unit tests ./venv/bin/python ./unitest.py ./venv/bin/python ./unitest-restful.py ./venv/bin/python ./unitest-xmlrpc.py - ./venv/bin/python -m black ./glances --check --exclude outputs/static + ./venv-dev/bin/python -m black ./glances --check --exclude outputs/static test-with-upgrade: venv-upgrade venv-dev-upgrade ## Upgrade deps and run unit tests ./venv/bin/python ./unitest.py ./venv/bin/python ./unitest-restful.py ./venv/bin/python ./unitest-xmlrpc.py - ./venv/bin/python -m black ./glances --check --exclude outputs/static + ./venv/bin-dev/python -m black ./glances --check --exclude outputs/static test-min: ## Run unit tests in minimal environment ./venv-min/bin/python ./unitest.py diff --git a/docs/api.rst b/docs/api.rst index fb8ec54e..3ce53099 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -141,7 +141,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.3963778018951416}, + "timer": 0.3574647903442383}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -150,7 +150,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.3962833881378174}] + "timer": 0.35736703872680664}] Fields descriptions: @@ -178,7 +178,7 @@ Get a specific item when field matches the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.3963778018951416}]} + "timer": 0.3574647903442383}]} GET cloud --------- @@ -219,7 +219,23 @@ GET containers Get plugin stats:: # curl http://localhost:61208/api/4/containers - [] + [{"command": "tail -f /dev/null", + "cpu": {"total": 0.0}, + "cpu_percent": 0.0, + "created": "2024-05-06T08:20:31.859934699Z", + "engine": "docker", + "id": "f8d78b334f789955ab6dd0739c0bbb7e26ae3f24ed9e42c4a0d218a30377d2c8", + "image": ["catthehacker/ubuntu:act-22.04"], + "io": {"cumulative_ior": 100855808, "cumulative_iow": 0}, + "key": "name", + "memory": {"inactive_file": 1704656896, + "limit": 16422473728, + "usage": 1984933888}, + "memory_usage": 1984933888, + "name": "act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef", + "network": {}, + "status": "running", + "uptime": "yesterday"}] Fields descriptions: @@ -240,6 +256,35 @@ Fields descriptions: * **pod_name**: Pod name (only with Podman) (unit is *None*) * **pod_id**: Pod ID (only with Podman) (unit is *None*) +Get a specific field:: + + # curl http://localhost:61208/api/4/containers/name + {"name": ["act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef"]} + +Get a specific item when field matches the given value:: + + # curl http://localhost:61208/api/4/containers/name/act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef + {"act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef": [{"command": "tail " + "-f " + "/dev/null", + "cpu": {"total": 0.0}, + "cpu_percent": 0.0, + "created": "2024-05-06T08:20:31.859934699Z", + "engine": "docker", + "id": "f8d78b334f789955ab6dd0739c0bbb7e26ae3f24ed9e42c4a0d218a30377d2c8", + "image": ["catthehacker/ubuntu:act-22.04"], + "io": {"cumulative_ior": 100855808, + "cumulative_iow": 0}, + "key": "name", + "memory": {"inactive_file": 1704656896, + "limit": 16422473728, + "usage": 1984933888}, + "memory_usage": 1984933888, + "name": "act-test-test-freebsd-700362a4fd49fe930f7ab89909c5ca853cd3a832c27b6ac4e363947b0dd29bef", + "network": {}, + "status": "running", + "uptime": "yesterday"}]} + GET core -------- @@ -265,18 +310,18 @@ Get plugin stats:: # curl http://localhost:61208/api/4/cpu {"cpucore": 16, - "ctx_switches": 542181838, + "ctx_switches": 100084028, "guest": 0.0, "idle": 3.0, - "interrupts": 420410414, + "interrupts": 99754405, "iowait": 0.0, "irq": 0.0, "nice": 0.0, - "soft_interrupts": 157550864, + "soft_interrupts": 30928307, "steal": 0.0, "syscalls": 0, - "system": 0.0, - "total": 0.0, + "system": 1.0, + "total": 25.0, "user": 0.0} Fields descriptions: @@ -310,7 +355,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/4/cpu/total - {"total": 0.0} + {"total": 25.0} GET diskio ---------- @@ -320,14 +365,14 @@ Get plugin stats:: # curl http://localhost:61208/api/4/diskio [{"disk_name": "nvme0n1", "key": "disk_name", - "read_bytes": 7451868160, - "read_count": 348351, - "write_bytes": 115766309888, - "write_count": 3401479}, + "read_bytes": 5494942208, + "read_count": 276248, + "write_bytes": 12631118848, + "write_count": 434825}, {"disk_name": "nvme0n1p1", "key": "disk_name", - "read_bytes": 7489024, - "read_count": 601, + "read_bytes": 7484416, + "read_count": 592, "write_bytes": 1024, "write_count": 2}] @@ -363,10 +408,10 @@ Get a specific item when field matches the given value:: # curl http://localhost:61208/api/4/diskio/disk_name/nvme0n1 {"nvme0n1": [{"disk_name": "nvme0n1", "key": "disk_name", - "read_bytes": 7451868160, - "read_count": 348351, - "write_bytes": 115766309888, - "write_count": 3401479}]} + "read_bytes": 5494942208, + "read_count": 276248, + "write_bytes": 12631118848, + "write_count": 434825}]} GET folders ----------- @@ -393,13 +438,13 @@ Get plugin stats:: # curl http://localhost:61208/api/4/fs [{"device_name": "/dev/mapper/ubuntu--vg-ubuntu--lv", - "free": 915914182656, + "free": 906483245056, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 3.9, + "percent": 4.8, "size": 1003736440832, - "used": 36759752704}] + "used": 46190690304}] Fields descriptions: @@ -420,13 +465,13 @@ Get a specific item when field matches the given value:: |