diff options
Diffstat (limited to 'docs/api.rst')
-rw-r--r-- | docs/api.rst | 1163 |
1 files changed, 611 insertions, 552 deletions
diff --git a/docs/api.rst b/docs/api.rst index 1d844ca3..832a5781 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -60,25 +60,6 @@ Get the plugins list:: "uptime", "wifi"] -GET alert ---------- - -Get plugin stats:: - - # curl http://localhost:61208/api/3/alert - [[1667486328.0, - -1, - "WARNING", - "MEM", - 70.7784407976031, - 70.7784407976031, - 70.7784407976031, - 70.7784407976031, - 1, - [], - "", - "memory_percent"]] - GET amps -------- @@ -93,7 +74,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8428387641906738}, + "timer": 0.8183016777038574}, {"count": 0, "countmax": 20.0, "countmin": None, @@ -102,7 +83,7 @@ Get plugin stats:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8426706790924072}] + "timer": 0.8182027339935303}] Get a specific field:: @@ -120,7 +101,7 @@ Get a specific item when field matchs the given value:: "refresh": 3.0, "regex": True, "result": None, - "timer": 0.8428387641906738}]} + "timer": 0.8183016777038574}]} GET core -------- @@ -150,19 +131,19 @@ Get plugin stats:: "ctx_switches": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 47.3, + "idle": 70.9, "interrupts": 0, "iowait": 0.0, "irq": 0.0, "nice": 0.0, "soft_interrupts": 0, - "softirq": 0.3, + "softirq": 0.0, "steal": 0.0, "syscalls": 0, - "system": 9.2, + "system": 4.0, "time_since_update": 1, - "total": 40.1, - "user": 43.2} + "total": 29.8, + "user": 25.2} Fields descriptions: @@ -185,7 +166,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/cpu/total - {"total": 40.1} + {"total": 29.8} GET diskio ---------- @@ -230,19 +211,98 @@ 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": 15155200, - "name": "portainer", - "network_rx": None, - "network_tx": None}] + {"containers": [{"Command": ["docker-entrypoint.sh", "mongod"], + "Id": "c3a1bb27858df965e1c524c6ef33c0fd26d765cae5bcd90fbe9e662b703a52aa", + "Image": ["mongo:latest"], + "Status": "running", + "Uptime": "1 months", + "cpu": {"total": 0.0}, + "cpu_percent": 0.0, + "io": {"cumulative_ior": 847872, + "cumulative_iow": 53813248, + "time_since_update": 1}, + "io_r": None, + "io_w": None, + "key": "name", + "memory": {"cache": None, + "limit": 7836196864, + "max_usage": None, + "rss": None, + "usage": 23642112}, + "memory_usage": 23642112, + "name": "docker-mongo_mongo_1", + "network": {"cumulative_rx": 37744307, + "cumulative_tx": 28244833, + "time_since_update": 1}, + "network_rx": None, + "network_tx": None}, + {"Command": ["tini", + "--", + "/docker-entrypoint.sh", + "mongo-express"], + "Id": "5aa8f03d6027d00244cf5ce5f4ffe616fd8a31e95ff7091ca02b8d99c00b276c", + "Image": ["mongo-express:latest"], + "Status": "running", + "Uptime": "1 months", + "cpu": {"total": 0.0}, + "cpu_percent": 0.0, + "io": {}, + "io_r": None, + "io_w": None, + "key": "name", + "memory": {}, + "memory_usage": None, + "name": "docker-mongo_mongo-express_1", + "network": {}, + "network_rx": None, + "network_tx": None}, + {"Command": ["/portainer"], + "Id": "3abd51c615968482d9ccff5afc629f267f6dda113ed68b75b432615fae3b49fb", + "Image": ["portainer/portainer-ce:2.9.3"], + "Status": "running", + "Uptime": "1 months", + "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.42", + "Arch": "amd64", + "BuildTime": "2023-02-01T17:49:08.000000000+00:00", + "Components": [{"Details": {"ApiVersion": "1.42", + "Arch": "amd64", + "BuildTime": "2023-02-01T17:49:08.000000000+00:00", + "Experimental": "false", + "GitCommit": "d7573ab", + "GoVersion": "go1.19.5", + "KernelVersion": "5.15.0-58-generic", + "MinAPIVersion": "1.12", + "Os": "linux"}, + "Name": "Engine", + "Version": "23.0.0"}, + {"Details": {"GitCommit": "31aa4358a36870b21a992d3ad2bef29e1d693bec"}, + "Name": "containerd", + "Version": "1.6.16"}, + {"Details": {"GitCommit": "v1.1.4-0-g5fd4c4d"}, + "Name": "runc", + "Version": "1.1.4"}, + {"Details": {"GitCommit": "de40ad0"}, + "Name": "docker-init", + "Version": "0.19.0"}], + "GitCommit": "d7573ab", + "GoVersion": "go1.19.5", + "KernelVersion": "5.15.0-58-generic", + "MinAPIVersion": "1.12", + "Os": "linux", + "Platform": {"Name": "Docker Engine - Community"}, + "Version": "23.0.0"}} GET fs ------ @@ -251,13 +311,13 @@ Get plugin stats:: # curl http://localhost:61208/api/3/fs [{"device_name": "/dev/mapper/ubuntu--gnome--vg-root", - "free": 64626642944, + "free": 53470863360, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 72.0, + "percent": 76.8, "size": 243334156288, - "used": 166320058368}, + "used": 177475837952}, {"device_name": "zsfpool", "free": 41811968, "fs_type": "zfs", @@ -276,13 +336,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": 64626642944, + "free": 53470863360, "fs_type": "ext4", "key": "mnt_point", "mnt_point": "/", - "percent": 72.0, + "percent": 76.8, "size": 243334156288, - "used": 166320058368}]} + "used": 177475837952}]} GET ip ------ @@ -290,11 +350,11 @@ GET ip Get plugin stats:: # curl http://localhost:61208/api/3/ip - {"address": "192.168.0.48", + {"address": "192.168.0.32", "gateway": "192.168.0.254", "mask": "255.255.255.0", "mask_cidr": 24, - "public_address": "82.66.169.82", + "public_address": "91.166.228.228", "public_info_human": ""} Get a specific field:: @@ -309,9 +369,9 @@ Get plugin stats:: # curl http://localhost:61208/api/3/load {"cpucore": 4, - "min1": 2.57275390625, - "min15": 1.9169921875, - "min5": 2.05908203125} + "min1": 0.79833984375, + "min15": 0.7431640625, + "min5": 0.8056640625} Fields descriptions: @@ -323,7 +383,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/load/min1 - {"min1": 2.57275390625} + {"min1": 0.79833984375} GET mem ------- @@ -331,16 +391,16 @@ GET mem Get plugin stats:: # curl http://localhost:61208/api/3/mem - {"active": 2859896832, - "available": 2289856512, - "buffers": 244420608, - "cached": 2865504256, - "free": 2289856512, - "inactive": 3594788864, - "percent": 70.8, - "shared": 670150656, - "total": 7836188672, - "used": 5546332160} + {"active": 2350882816, + "available": 2422988800, + "buffers": 131072000, + "cached": 2795134976, + "free": 2422988800, + "inactive": 3522777088, + "percent": 69.1, + "shared": 685944832, + "total": 7836196864, + "used": 5413208064} Fields descriptions: @@ -359,7 +419,7 @@ Fields descriptions: Get a specific field:: # curl http://localhost:61208/api/3/mem/total - {"total": 7836188672} + {"total": 7836196864} GET memswap ----------- @@ -367,13 +427,13 @@ GET memswap Get plugin stats:: # curl http://localhost:61208/api/3/memswap - {"free": 4244574208, - "percent": 47.5, - "sin": 2742693888, - "sout": 8789086208, + {"free": 5875109888, + "percent": 27.3, + "sin": 8760786944, + "sout": 14506393600, "time_since_update": 1, "total": 8082419712, - "used": 3837845504} + "used": 2207309824} Fields descriptions: @@ -397,29 +457,29 @@ Get plugin stats:: # curl http://localhost:61208/api/3/network [{"alias": None, - "cumulative_cx": 450898582, - "cumulative_rx": 225449291, - "cumulative_tx": 225449291, - "cx": 7262, + "cumulative_cx": 1140515614, + "cumulative_rx": 570257807, + "cumulative_tx": 570257807, + "cx": 5342, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 3631, + "rx": 2671, "speed": 0, "time_since_update": 1, - "tx": 3631}, + "tx": 2671}, {"alias": None, - "cumulative_cx": 10030241644, - "cumulative_rx": 9391810395, - "cumulative_tx": 638431249, - "cx": 29813, + "cumulative_cx": 36011739106, + "cumulative_rx": 34790353651, + "cumulative_tx": 1221385455, + "cx": 24457, "interface_name": "wlp2s0", "is_up": True, "key": "interface_name", - "rx": 22832, + "rx": 18960, "speed": 0, "time_since_update": 1, - "tx": 6981}] + "tx": 5497}] Fields descriptions: @@ -427,8 +487,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*) @@ -438,28 +500,32 @@ Get a specific field:: # curl http://localhost:61208/api/3/network/interface_name {"interface_name": ["lo", "wlp2s0", - "br-87386b77b676", "br_grafana", "br-119e6ee04e05", "docker0", - "vethfb650c2", - "mpqemubr0"]} + "br-87386b77b676", + "mpqemubr0", + "tap-1e376645a40", + "br-ef0a06c4e10f", + "veth9910148", + "veth5e7315e", + "veth24ae93e"]} 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": 450898582, - "cumulative_rx": 225449291, - "cumulative_tx": 225449291, - "cx": 7262, + "cumulative_cx": 1140515614, + "cumulative_rx": 570257807, + "cumulative_tx": 570257807, + "cx": 5342, "interface_name": "lo", "is_up": True, "key": "interface_name", - "rx": 3631, + "rx": 2671, "speed": 0, "time_since_update": 1, - "tx": 3631}]} + "tx": 2671}]} GET now ------- @@ -467,7 +533,7 @@ GET now Get plugin stats:: # curl http://localhost:61208/api/3/now - "2022-11-03 15:38:47 CET" + "2023-03-11 17:30:43 CET" GET percpu ---------- @@ -478,29 +544,29 @@ Get plugin stats:: [{"cpu_number": 0, "guest": 0.0, "guest_nice": 0.0, - "idle": 63.8, + "idle": 22.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 4.8, - "total": 36.2, - "user": 31.4}, + "system": 1.0, + "total": 78.0, + "user": 67.0}, {"cpu_number": 1, "guest": 0.0, "guest_nice": 0.0, - "idle": 75.0, + "idle": 81.0, "iowait": 0.0, "irq": 0.0, "key": "cpu_number", "nice": 0.0, "softirq": 0.0, "steal": 0.0, - "system": 5.0, - "total": 25.0, - "user": 16.0}] + "system": 2.0, + "total": 19.0, + "user": 7.0}] Get a specific field:: @@ -519,7 +585,7 @@ Get plugin stats:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.027686, + "status": 0.003449, "timeout": 3}] Get a specific field:: @@ -536,7 +602,7 @@ Get a specific item when field matchs the given value:: "port": 0, "refresh": 30, "rtt_warning": None, - "status": 0.027686, + "status": 0.003449, "timeout": 3}]} GET processcount @@ -545,12 +611,12 @@ GET processcount Get plugin stats:: # curl http://localhost:61208/api/3/processcount - {"pid_max": 0, "running": 3, "sleeping": 324, "thread": 1659, "total": 393} + {"pid_max": 0, "running": 1, "sleeping": 319, "thread": 1542, "total": 387} Get a specific field:: # curl http://localhost:61208/api/3/processcount/total - {"total": 393} + {"total": 387} GET processlist --------------- @@ -558,51 +624,51 @@ GET processlist Get plugin stats:: # curl http://localhost:61208/api/3/processlist - [{"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox"], + [{"cmdline": ["/snap/firefox/2391/usr/lib/firefox/firefox"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=8365.21, system=2822.21, children_user=7790.52, children_system=1387.48, iowait=0.0), - "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [4765441024, 9684750336, 0, 0, 0], + "cpu_times": [1287.11, 419.09, 1097.08, 148.64, 0.0], + "gids": [1000, 1000, 1000], + "io_counters": [502609920, 1333940224, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=556318720, vms=13286076416, shared=121720832, text=634880, lib=0, data=1310076928, dirty=0), - "memory_percent": 7.099353311742211, + "memory_info": [509206528, 21605502976, 176431104, 626688, 0, 833679360, 0], + "memory_percent": 6.498133429231825, "name": "firefox", "nice": 0, - "num_threads": 151, - "pid": 252940, + "num_threads": 117, + "pid": 846720, "status": "S", "time_since_update": 1, "username": "nicolargo"}, - {"cmdline": ["/snap/firefox/1943/usr/lib/firefox/firefox", + {"cmdline": ["/snap/firefox/2391/usr/lib/firefox/firefox", "-contentproc", "-childID", "1", "-isForBrowser", "-prefsLen", - "30965", + "31514", "-prefMapSize", - "235589", + "238439", "-jsInitLen", - "246848", + "246560", "-parentBuildID", - "20221007191409", + "20230228074855", "-appDir", - "/snap/firefox/1943/usr/lib/firefox/browser", - "{9845d5f8-7cf9-4af9-9d46-4d914b28196f}", - "252940", + "/snap/firefox/2391/usr/lib/firefox/browser", + "{0f8147f2-5422-4d6d-9491-68894fb5c106}", + "846720", "true", "tab"], "cpu_percent": 0.0, - "cpu_times": pcputimes(user=1498.65, system=289.34, children_user=0.0, children_system=0.0, iowait=0.0), - "gids": pgids(real=1000, effective=1000, saved=1000), - "io_counters": [204542976, 0, 0, 0, 0], + "cpu_times": [185.15, 34.08, 0.0, 0.0, 0.0], + "gids": [1000, 1000, 1000], + "io_counters": [9207808, 0, 0, 0, 0], "key": "pid", - "memory_info": pmem(rss=445616128, vms=3534884864, shared=79106048, text=634880, lib=0, data=932179968, dirty=0), - "memory_percent": 5.686643681669639, + "memory_info": [435576832, 3219697664, 100659200, 626688, 0, 613511168, 0], + "memory_percent": 5.558523344418112, "name": "WebExtensions", "nice": 0, - "num_threads": 21, - "pid": 253132, + "num_threads": 20, + "pid": 846991, "status": "S", "time_since_update": 1, "username": "nicolargo"}] @@ -610,234 +676,223 @@ Get plugin stats:: Get a specific field:: # curl http://localhost:61208/api/3/processlist/pid - {"pid": [252940, - 253132, - 3549, - 590528, - 253182, - 590488, - 607540, - 479037, - 479255, - 604831, - 253186, - 479104, - 17347, - 549166, - 253147, - 51440, - 478972, - 479089, - 601048, - 608133, - 608049, - 608003, - 480067, - 602074, - 450641, - 479007, - 597870, - 482393, - 590512, - 603305, - 608247, - 546430, - 4055, - 602075, - 495478, - 3958, - 3499, - 546431, - 2245, - 521697, - 479112, - 521756, - 590492, - 253071, - 253654, - 521757, - 450239, - 16698, - 479015, - 521726, - 255947, - 557500, - 479296, - 2917, - 449090, - 3651, - 2429, - 3844, - 3364, - 521696, - 4977, - 3744, - 450957, - 1369, - 3743, - 17373, - 17566, - 4062, - 17754, + {"pid": [846720, + 846991, + 847043, + 4150, + 847035, + 255919, + 255685, + 847039, + 859882, + 836010, + 255737, + 847051, + 4473, + 847007, + 285410, + 422, + 875536, + 255627, + 258480, + 6074, + 255751, + 876641, + 876390, + 847507, + 876962, + 255664, + 62850, + 877142, + 2512, + 4544, + 4035, + 846970, + 847508, + 256270, + 258481, + 255769, + 596789, + 285072, + 95798, + 2721, + 4585, + 255672, + 4413, + 789543, + 860282, + 285950, + 4248, + 789544, + 3955, + 286011, + 255906, + 255976, + 4932, + 1635, + 829380, + 829424, + 14455, 1, - 3737, - 107498, - 3627, - 3929, - 1391, - 566917, - 1415, - 478976, - 3760, - 544074, - 17501, - 3618, - 19717, - 3742, - 3345, - 1587, - 603476, - 3528, - 107499, - 4087, - 544139, - 3663, - 492260, - 1945, - 3806, - 3592, - 478977, - 17308, - 3736, - 109608, - 3353, - 1381, - 17346, - 3557, - 480091, - 17292, - 3750, - 2371, - 1416, - 1593, - 1368, - 3745, - 3637, - 1487, - 3378, - 2412, - 1352, - 17755, - 2187, - 3891, - 3739, - 3817, - 1408, - 3373, - 51420, - 15018, - 1917, - 3799, - 3616, - 14997, - 3697, - 3380, - 1615, - 17237, - 1392, - 3943, - 3599, - 3588, - 54676, - 483374, - 1375, - 3905, - 3755, - 3547, - 3633, - 1407, - 3741, - 3813, - 3604, - 3444, - 3569, - 523017, - 3583, - 3734, - 3747, - 1397, - 3753, - 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, - 2405, - 450933, - 568871, - 1470, - 2920, + 4325, + 4331, + 4223, + 4332, + 4561, + 4214, + 3351, + 4625, + 1660, + 1681, + 219792, + 14458, + 1876, + 4327, + 3934, + 3944, + 5299, + 4182, + 4130, + 4659, + 4263, + 4445, + 286108, + 4339, + 4233, + 4137, + 2239, + 1682, + 129087, + 4352, + 129101, + 4261, + 255632, + 830552, + 823483, + 17189, + 4377, + 129097, + 3968, + 1634, + 1442, + 255633, + 1777, + 2179, + 117714, + 59511, + 4330, + 4452, + 1643, + 706956, + 17205, + 1655, + 4524, + 3700, + 706252, + 3966, + 4229, + 3971, + 1873, + 96102, + 4201, + 4192, + 1673, + 4334, + 4392, + 4155, + 4329, + 4443, + 1617, + 4328, + 1675, + 4573, + 4485, + 1661, + 4337, + 4050, + 285853, + 1631, + 4178, + 4166, + 1666, + 4348, + 4324, + 4335, + 4045, + 4347, + 285970, + 285913, + 4173, + 468, + 4212, + 3976, + 1885, + 1626, + 1676, + 4314, + 1670, + 9703, + 1646, + 4119, + 1443, + 877118, + 3952, + 129099, + 49191, + 2020, + 255649, + 1633, + 4162, + 1441, + 14505, + 49179, 3953, - 608222, - 17516, - 2406, - 181215, - 58637, - 478993, - 58407, - 54523, - 1363, - 181218, - 181225, - 1353, - 478979, - 608246, - 181228, - 2208, - 3733, - 4187, - 450920, - 3425, - 450913, - 594820, - 450892, - 450882, - 58639, - 2226, + 3701, 3354, - 567106, - 2252, - 1485, - 568756, - 568754, - 568874, - 181221, + 129100, + 1449, + 1685, + 4579, + 1450, + 2472, + 219931, + 49182, + 1618, + 843176, + 877141, + 1804, + 49194, + 1803, + 4323, + 2480, + 3707, + 4018, + 255635, + 285883, + 285777, + 285877, + 872737, + 285835, + 285843, + 285784, + 285905, + 3945, + 4820, + 285898, + 2475, + 1447, + 2503, + 2485, + 706960, + 1628, + 1695, + 49185, 2, 3, 4, 5, - 7, - 9, + 6, + 8, 10, 11, 12, @@ -879,152 +934,157 @@ Get a specific field:: 99, 100, 101, - 103, - 105, + 104, 106, - 108, + 107, + 109, 110, 112, - 114, + 117, 118, - 119, - 121, - 130, - 133, - 139, - 188, - 195, - 196, - 197, - 198, - 199, - 200, + 128, + 131, + 137, + 171, + 175, 201, - 202, - 210, - 211, - 216, + 205, 217, - 234, - 283, - 284, - 359, + 218, + 219, + 220, + 221, + 222, + 223, + 224, + 248, + 249, + 254, + 255, + 312, + 361, 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, - 5865 |