Update API docs

This commit is contained in:
nicolargo 2024-12-22 20:02:44 +01:00
parent 077d5fee5b
commit c6e7281e1b
3 changed files with 403 additions and 312 deletions

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "GLANCES" "1" "Dec 21, 2024" "4.3.0_dev05" "Glances"
.TH "GLANCES" "1" "Dec 22, 2024" "4.3.0_dev06" "Glances"
.SH NAME
glances \- An eye on your system
.SH SYNOPSIS

View File

@ -316,6 +316,21 @@ def print_limits(stats):
print('')
def print_plugin_post_events():
sub_title = 'POST clear events'
print(sub_title)
print('-' * len(sub_title))
print('')
print('Clear all alarms from the list::')
print('')
print(f' # curl -H "Content-Type: application/json" -X POST {API_URL}/events/clear/all')
print('')
print('Clear warning alarms from the list::')
print('')
print(f' # curl -H "Content-Type: application/json" -X POST {API_URL}/events/clear/warning')
print('')
class GlancesStdoutApiDoc:
"""This class manages the fields description display."""
@ -344,6 +359,8 @@ class GlancesStdoutApiDoc:
stat = stats.get_plugin(plugin)
print_plugin_stats(plugin, stat)
print_plugin_description(plugin, stat)
if plugin == 'alert':
print_plugin_post_events()
stat_export = stat.get_export()
if stat_export is None or stat_export == [] or stat_export == {}: