diff options
Diffstat (limited to 'docs/api.rst')
-rw-r--r-- | docs/api.rst | 1125 |
1 files changed, 588 insertions, 537 deletions
diff --git a/docs/api.rst b/docs/api.rst index 4609b516..d60c548f 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -74,7 +74,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.82912278175354}, + "timer": 0.8425271511077881}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -83,7 +83,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8289539813995361}] + "timer": 0.8423657417297363}] Get a specific field:: @@ -101,7 +101,7 @@ Get a specific item when field matchs the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.82912278175354}]} + "timer": 0.8425271511077881}]} GET core -------- @@ -131,19 +131,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 60.1, + "idle": 58.6, "interrupts": 0, "iowait": 0.0, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, - "softirq": 0.2, + "softirq": 0.0, "steal": 0.0, "syscalls": 0, - "system": 5.3, + "system": 6.7, "time_since_update": 1, - "total": 40.6, - "user": 34.4} + "total": 38.2, + "user": 34.7} Fields descriptions: @@ -166,7 +166,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 40.6} + {"total": 38.2} GET diskio ---------- @@ -211,19 +211,53 @@ GET docker Get plugin stats:: # curl http://localhost:61208/api/3/docker - [{"Command": ["/portainer"], - "Id": "3abd51c615968482d9ccff5afc629f267f6dda113ed68b75b432615fae3b49fb", - "Image": ["portainer/portainer-ce:2.9.3"], - "Status": "running", - "Uptime": "4 days", - "cpu_percent": 0.0, - "io_r": None, - "io_w": None, - "key": "name", - "memory_usage": None, - "name": "portainer", - "network_rx": None, - "network_tx": None}] + {"containers": [{"Command": ["/portainer"], + "Id": "3abd51c615968482d9ccff5afc629f267f6dda113ed68b75b432615fae3b49fb", + "Image": ["portainer/portainer-ce:2.9.3"], + "Status": "running", + "Uptime": "36 mins", + "cpu": {"total": 0.0}, + "cpu_percent": 0.0, + "io": {}, + "io_r": None, + "io_w": None, + "key": "name", + "memory": {}, + "memory_usage": None, + "name": "portainer", + "network": {}, + "network_rx": None, + "network_tx": None}], + "version": {"ApiVersion": "1.41", + "Arch": "amd64", + "BuildTime": "2022-12-15T22:25:58.000000000+00:00", + "Components": [{"Details": {"ApiVersion": "1.41", + "Arch": "amd64", + "BuildTime": "2022-12-15T22:25:58.000000000+00:00", + "Experimental": "false", + "GitCommit": "42c8b31", + "GoVersion": "go1.18.9", + "KernelVersion": "5.15.0-56-generic", + "MinAPIVersion": "1.12", + "Os": "linux"}, + "Name": "Engine", + "Version": "20.10.22"}, + {"Details": {"GitCommit": "5b842e528e99d4d4c1686467debf2bd4b88ecd86"}, + "Name": "containerd", + "Version": "1.6.15"}, + {"Details": {"GitCommit": "v1.1.4-0-g5fd4c4d"}, + "Name": "runc", + "Version": "1.1.4"}, + {"Details": {"GitCommit": "de40ad0"}, + "Name": "docker-init", + "Version": "0.19.0"}], + "GitCommit": "42c8b31", + "GoVersion": "go1.18.9", + "KernelVersion": "5.15.0-56-generic", + "MinAPIVersion": "1.12", + "Os": "linux", + "Platform": {"Name": "Docker Engine - Community"}, + "Version": "20.10.22"}} GET fs ------ @@ -232,13 +266,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 64636235776, + "free": 50442330112, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 72.0, + "percent": 78.2, "size": 243334156288, - "used": 166310465536}, + "used": 180504371200}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -257,13 +291,13 @@ Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/fs/mnt_point// {"/": [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 64636235776, + "free": 50442330112, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 72.0, + "percent": 78.2, "size": 243334156288, - "used": 166310465536}]} + "used": 180504371200}]} GET ip ------ @@ -271,17 +305,17 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {"address": "192.168.0.48", - "gateway": "192.168.0.254", + {"address": "192.168.1.14", + "gateway": "192.168.1.1", "mask": "255.255.255.0", "mask_cidr": 24, - "public_address": "82.66.169.82", + "public_address": "109.210.93.150", "public_info_human": ""} Get a specific field:: # curl http://localhost:61208/api/3/ip/gateway - {"gateway": "192.168.0.254"} + {"gateway": "192.168.1.1"} GET load -------- @@ -289,7 +323,7 @@ GET load Get plugin stats:: # curl http://localhost:61208/api/3/load - {"cpucore": 4, "min1": 1.79931640625, "min15": 1.958984375, "min5": 2.16015625} + {"cpucore": 4, "min1": 1.31591796875, "min15": 1.9091796875, "min5": 1.6796875} Fields descriptions: @@ -301,7 +335,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 1.79931640625} + {"min1": 1.31591796875} GET mem ------- @@ -309,16 +343,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2861182976, - "available": 2539823104, - "buffers": 288755712, - "cached": 3050266624, - "free": 2539823104, - "inactive": 3463237632, - "percent": 67.6, - "shared": 680669184, + {"active": 2804523008, + "available": 2706178048, + "buffers": 264335360, + "cached": 3114909696, + "free": 2706178048, + "inactive": 3516907520, + "percent": 65.5, + "shared": 591532032, "total": 7836188672, - "used": 5296365568} + "used": 5130010624} Fields descriptions: @@ -345,13 +379,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 4256415744, - "percent": 47.3, - "sin": 2738352128, - "sout": 8773423104, + {"free": 2626473984, + "percent": 67.5, + "sin": 4755005440, + "sout": 11063549952, "time_since_update": 1, "total": 8082419712, - "used": 3826003968} + "used": 5455945728} Fields descriptions: @@ -375,29 +409,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 449777162, - "cumulative_rx": 224888581, - "cumulative_tx": 224888581, - "cx": 5508, + "cumulative_cx": 398215554, + "cumulative_rx": 199107777, + "cumulative_tx": 199107777, + "cx": 3314, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 2754, + "rx": 1657, "speed": 0, "time_since_update": 1, - "tx": 2754}, + "tx": 1657}, {"alias": None, - "cumulative_cx": 10026810126, - "cumulative_rx": 9389174147, - "cumulative_tx": 637635979, - "cx": 25944, + "cumulative_cx": 39497892918, + "cumulative_rx": 38949809930, + "cumulative_tx": 548082988, + "cx": 27720, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 19839, + "rx": 21708, "speed": 0, "time_since_update": 1, - "tx": 6105}] + "tx": 6012}] Fields descriptions: @@ -405,8 +439,10 @@ Fields descriptions: * **alias**: Interface alias name (optional) (unit is *string*) * **rx**: The received/input rate (in bit per second) (unit is *bps*) * **tx**: The sent/output rate (in bit per second) (unit is *bps*) +* **cx**: The cumulative received+sent rate (in bit per second) (unit is *bps*) * **cumulative_rx**: The number of bytes received through the interface (cumulative) (unit is *bytes*) * **cumulative_tx**: The number of bytes sent through the interface (cumulative) (unit is *bytes*) +* **cumulative_cx**: The cumulative number of bytes reveived and sent through the interface (cumulative) (unit is *bytes*) * **speed**: Maximum interface speed (in bit per second). Can return 0 on some operating-system (unit is *bps*) * **is_up**: Is the interface up ? (unit is *bool*) * **time_since_update**: Number of seconds since last update (unit is *seconds*) @@ -416,28 +452,29 @@ Get a specific field:: # curl http://localhost:61208/api/3/network/interface_name {"interface_name": ["lo", "wlp2s0", + "docker0", + "br-119e6ee04e05", "br-87386b77b676", "br_grafana", - "br-119e6ee04e05", - "docker0", - "vethfb650c2", - "mpqemubr0"]} + "mpqemubr0", + "tap-1e376645a40", + "veth57bdacb"]} Get a specific item when field matchs the given value:: # curl http://localhost:61208/api/3/network/interface_name/lo {"lo": [{"alias": None, - "cumulative_cx": 449777162, - "cumulative_rx": 224888581, - "cumulative_tx": 224888581, - "cx": 5508, + "cumulative_cx": 398215554, + "cumulative_rx": 199107777, + "cumulative_tx": 199107777, + "cx": 3314, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 2754, + "rx": 1657, "speed": 0, "time_since_update": 1, - "tx": 2754}]} + "tx": 1657}]} GET now ------- @@ -445,7 +482,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2022-11-03 15:30:23 CET" + "2023-01-14 09:45:44 CET" GET percpu ---------- @@ -456,29 +493,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 59.2, + "idle": 56.1, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 4.9, - "total": 40.8, - "user": 35.9}, + "system": 4.7, + "total": 43.9, + "user": 39.3}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 82.0, + "idle": 28.2, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 5.0, - "total": 18.0, - "user": 13.0}] + "system": 3.9, + "total": 71.8, + "user": 68.0}] Get a specific field:: @@ -492,30 +529,30 @@ Get plugin stats:: # curl http://localhost:61208/api/3/ports [{"description": "DefaultGateway", - "host": "192.168.0.254", + "host": "192.168.1.1", "indice": "port_0", "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.005885, + "status": 0.007094, "timeout": 3}] Get a specific field:: # curl http://localhost:61208/api/3/ports/host - {"host": ["192.168.0.254"]} + {"host": ["192.168.1.1"]} Get a specific item when field matchs the given value:: - # curl http://localhost:61208/api/3/ports/host/192.168.0.254 - {"192.168.0.254": [{"description": "DefaultGateway", - "host": "192.168.0.254", - "indice": "port_0", - "port": 0, - "refresh": 30, - "rtt_warning": None, - "status": 0.005885, - "timeout": 3}]} + # curl http://localhost:61208/api/3/ports/host/192.168.1.1 + {"192.168.1.1": [{"description": "DefaultGateway", + "host": "192.168.1.1", + "indice": "port_0", + "port": 0, + "refresh": 30, + "rtt_warning": None, + "status": 0.007094, + "timeout": 3}]} GET processcount ---------------- @@ -523,12 +560,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 1, "sleeping": 326, "thread": 1654, "total": 389} + {"pid_max": 0, "running": 2, "sleeping": 334, "thread": 1765, "total": 403} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 389} + {"total": 403} GET processlist --------------- @@ -536,51 +573,51 @@ GET processlist Get plugin stats:: # curl http://localhost:61208/api/3/processlist - [{"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox"], + [{"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=8265.26, system=2792.3, children_user=7778.43, children_system=1384.62, iowait=0.0), - "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [4759993344, 9648111616, 0, 0, 0], + "cpu_times": [8504.75, 2803.93, 8401.36, 1489.57, 0.0], + "gids": [1000, 1000, 1000], + "io_counters": [6360911872, 11858505728, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=462217216, vms=13290643456, shared=124010496, text=634880, lib=0, data=1298190336, dirty=0), - "memory_percent": 5.898495242356513, + "memory_info": [484036608, 22242152448, 100323328, 659456, 0, 1409527808, 0], + "memory_percent": 6.176939176178121, "name": "firefox", "nice": 0, - "num_threads": 150, - "pid": 252940, + "num_threads": 187, + "pid": 4674, "status": "S", "time_since_update": 1, "username": "nicolargo"}, - {"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox", + {"cmdline": ["/snap/firefox/2154/usr/lib/firefox/firefox", "-contentproc", "-childID", "1", "-isForBrowser", "-prefsLen", - "30965", + "31799", "-prefMapSize", - "235589", + "234979", "-jsInitLen", - "246848", + "246704", "-parentBuildID", - "20221007191409", + "20221128185858", "-appDir", - "/snap/firefox/1943/usr/lib/firefox/browser", - "{9845d5f8-7cf9-4af9-9d46-4d914b28196f}", - "252940", + "/snap/firefox/2154/usr/lib/firefox/browser", + "{8ed7e0e9-5dcf-4c35-9523-65d5178968f5}", + "4674", "true", "tab"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=1479.73, system=286.38, children_user=0.0, children_system=0.0, iowait=0.0), - "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [201466880, 0, 0, 0, 0], + "cpu_times": [1878.88, 294.96, 0.0, 0.0, 0.0], + "gids": [1000, 1000, 1000], + "io_counters": [446676992, 0, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=448593920, vms=3538014208, shared=79355904, text=634880, lib=0, data=936325120, dirty=0), - "memory_percent": 5.724644196009476, + "memory_info": [379330560, 3766951936, 44253184, 659456, 0, 1161146368, 0], + "memory_percent": 4.840753277871052, "name": "WebExtensions", "nice": 0, "num_threads": 20, - "pid": 253132, + "pid": 4980, "status": "S", "time_since_update": 1, "username": "nicolargo"}] @@ -588,228 +625,234 @@ Get plugin stats:: Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid - {"pid": [252940, - 253132, - 3549, - 590528, - 590488, - 253182, - 479037, - 479255, - 604831, - 253186, - 479104, - 17347, - 549166, - 253147, - 51440, - 478972, - 479089, - 605726, - 601048, - 605889, - 606596, - 606103, - 450641, - 602074, - 480067, - 479007, - 597870, - 482393, - 590512, - 3499, - 606696, - 603305, - 546430, - 4055, - 602075, - 495478, - 3958, - 2245, - 546431, - 479112, - 521697, - 521756, - 590492, - 253071, - 253654, - 557500, - 521757, - 479015, - 16698, - 450239, - 521726, - 255947, - 479296, - 2917, - 3651, - 449090, - 2429, - 3844, - 3364, - 521696, - 4977, - 3744, - 1369, - 3743, - 17566, - 450957, - 17373, - 4062, - 17754, + {"pid": [4674, + 4980, + 5110, + 527830, + 173709, + 3699, + 5464, + 431554, + 495017, + 5113, + 173765, + 174093, + 87518, + 10140, + 93773, + 5000, + 173645, + 534445, + 511174, + 173751, + 534543, + 9953, + 534732, + 535113, + 284680, + 128927, + 173679, + 535159, + 4050, + 3586, + 4426, + 173949, + 493657, + 511164, + 2510, + 3351, + 173688, + 173781, + 496818, + 496817, + 408152, + 493678, + 4206, + 511549, + 427, + 173973, + 3820, + 5730, + 17316, + 174051, + 1616, + 3512, + 493683, 1, - 3737, - 3627, - 107498, - 3929, - 1391, - 566917, - 1415, - 478976, - 3760, - 544074, - 3618, - 17501, - 19717, - 3742, - 3345, - 1587, - 603476, - 3528, - 107499, - 4087, - 492260, - 3663, - 544139, - 1945, - 3806, - 3592, - 478977, - 17308, - 3736, - 109608, - 3353, - 1381, - 17346, - 3557, - 480091, - 17292, - 3750, - 2371, + 5690, + 3903, + 4008, + 165775, + 3792, + 174314, + 493699, + 94498, + 2702, + 1662, + 1641, + 87895, + 87994, + 4158, + 87995, + 174313, + 4433, + 87753, + 3897, + 5691, + 4458, + 87853, + 94497, + 4903, + 3902, + 17315, + 3829, + 173649, + 87454, + 3273, + 1838, + 3676, + 3783, + 3695, + 10499, + 87474, + 3907, + 2209, + 3730, + 3486, + 3915, + 3901, + 3910, + 10649, + 533610, + 10551, + 511526, + 10082, + 87412, + 1615, + 173650, + 4005, + 3904, + 10318, + 165937, + 1663, + 1777, + 2417, + 2626, + 10319, + 3805, + 10094, + 3956, + 1837, + 17467, + 1636, + 2688, + 4049, + 4089, + 3521, + 87413, + 87779, + 3861, 1416, - 1368, - 1593, - 3745, - 3637, - 1487, - 17755, - 3378, - 2412, - 1352, - 2187, - 3891, - 3739, - 3817, - 1408, - 3373, - 51420, - 15018, - 1917, - 3799, - 3616, - 14997, + 102131, + 10032, + 1782, + 1598, + 115869, + 17484, + 3970, + 1659, + 3524, + 465, + 2159, + 3898, + 3527, + 3802, + 5024, + 3743, + 1626, + 10033, + 3908, + 4036, 3697, - 3380, - 1615, - 17237, - 1392, - 3943, - 54676, - 3599, - 3588, - 483374, - 1375, - 3905, - 3755, - 3547, - 3633, - 1407, - 3813, - 3741, - 3604, - 3444, - 3569, - 523017, - 3583, - 3734, - 3747, - 1397, - 3753, + 4170, + 10048, + 1642, + 3906, + 1654, + 3717, + 173849, + 3591, + 3896, + 3726, + 3909, + 3722, + 3900, + 3781, + 3994, + 10381, 3748, - 17238, - 3804, - 1365, - 3362, - 1412, - 3437, - 3729, - 3385, - 3361, - 4518, - 1360, - 568870, - 3556, - 479311, - 3517, - 54624, - 282637, - 1399, - 1743, - 1377, - 1176, - 17258, - 602118, - 1367, - 568871, - 2405, - 450933, - 1470, - 2920, - 3953, - 606671, - 17516, - 2406, - 181215, - 58637, - 478993, - 58407, - 54523, - 1363, - 181218, - 181225, - 1353, - 478979, - 606695, - 181228, - 2208, - 3733, + 87429, + 3584, + 3905, + 1868, + 1612, + 3891, + 112675, + 1607, + 1660, + 3533, + 3510, + 98474, + 10372, + 3508, + 1648, + 1652, + 3706, + 3664, + 1629, + 1999, + 1614, + 1415, + 535105, + 1419, + 1666, 4187, - 450920, - 3425, - 450913, - 594820, - 450892, - 450882, - 58639, - 2226, + 2680, + 173665, + 1432, + 17364, + 2681, + 1430, + 2428, 3354, - 567106, - 2252, - 1485, - 568756, - 568754, - 568874, - 181221, + 142951, + 1609, + 98475, + 1599, + 535158, + 5769, + 10035, + 173652, + 87415, + 3895, + 2483, + 511483, + 3572, + 511504, + 191811, + 98353, + 98484, + 511512, + 532452, + 98346, + 511490, + 4546, + 3487, + 2430, + 2492, + 2465, + 1431, + 1669, 2, 3, 4, @@ -857,151 +900,159 @@ Get a specific field:: 99, 100, 101, - 103, + 104, 105, - 106, 108, 110, 112, - 114, + 113, 118, 119, + 120, 121, - 130, - 133, - 139, - 188, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 210, - 211, - 216, - 217, - 234, - 283, - 284, - 359, - 362, - 386, - 485, - 495, - 559, - 560, - 561, - 562, - 778, - 779, - 780, - 781, - 788, - 789, - 790, - 791, - 792, - 793, - 794, - 795, - 848, - 849, - 850, - 851, - 852, - 853, - 854, - 855, - 856, - 857, - 858, - 859, - 860, - 861, - 862, - 863, - 864, - 865, - 866, - 890, - 891, - 898, - 899, - 915, - 916, - 917, - 918, - 919, - 920, - 921, - 1891, - 1897, - 2256, - 2266, - 3584, - 17240, - 17274, - 58642, - 58643, - 58644, - 58645, - 58646, - 58647, - 58648, - 58649, - 58650, - 543848, - 543849, - 543851, - 557402, - 557403, - 557405, - 557406, - 557407, - 557455, - 599164, - 599474, - 600991, - 600996, - 601072, - 602168, - 604267, - 604944, - 605001, - 605075, - 605094, - 605572, - 605573, - 605888, - 606456]} + 131, + 135, + 141, + 204, + 218, + 219, + 220, + 221, + 222, + 223, + 224, + 225, + 249, + 250, + 255, + 256, + 313, + 366, + 367, + 447, + 448, + 545, + 614, + 685, + 686, + 687, + 694, + 950, + 951, + 952, + 953, + 956, + 957, + 958, + 959, + 960, + 961, + 966, + 967, + 1021, + 1022, + 1023, + 1024, + 1025, + 1026, + 1027, + 1028, + 1029, + 1030, + 1031, + 1032, + 1033, + 1034, + 1035, + 1036, + 1037, + 1038, + 1039, + 1056, + 1057, + 1065, + 1066, + 1083, + 1084, + 1085, |