Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
蜕变的菜鸟
glances
提交
39faa7f2
G
glances
项目概览
蜕变的菜鸟
/
glances
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glances
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
39faa7f2
编写于
7月 17, 2021
作者:
N
nicolargo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reformat API doc 2
上级
9c4fe9ca
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
174 addition
and
136 deletion
+174
-136
docs/api.rst
docs/api.rst
+155
-124
glances/outputs/glances_stdout_apidoc.py
glances/outputs/glances_stdout_apidoc.py
+19
-12
未找到文件。
docs/api.rst
浏览文件 @
39faa7f2
此差异已折叠。
点击以展开。
glances/outputs/glances_stdout_apidoc.py
浏览文件 @
39faa7f2
...
...
@@ -54,17 +54,15 @@ def indent_stat(stat, indent=' '):
def
print_plugins_list
(
stat
):
print
(
"""
\
GET Plugins list
----------------
.. code-block:: json
# curl {}/pluginslist
{}
"""
.
format
(
API_URL
,
indent_stat
(
stat
)))
sub_title
=
'GET plugins list'
print
(
sub_title
)
print
(
'-'
*
len
(
sub_title
))
print
(
''
)
print
(
'Get the plugins list::'
)
print
(
''
)
print
(
' # curl {}/pluginslist'
.
format
(
API_URL
))
print
(
indent_stat
(
stat
))
print
(
''
)
def
print_plugin_export
(
plugin
,
stat_export
):
...
...
@@ -73,7 +71,7 @@ def print_plugin_export(plugin, stat_export):
print
(
'-'
*
len
(
sub_title
))
print
(
''
)
print
(
'Get
the plugins list
::'
)
print
(
'Get
plugin stats
::'
)
print
(
''
)
print
(
' # curl {}/{}'
.
format
(
API_URL
,
plugin
))
print
(
indent_stat
(
stat_export
))
...
...
@@ -112,11 +110,13 @@ def print_plugin_item_value(plugin, stat, stat_export):
else
:
value
=
stat_item
[
item
]
print
(
'Get a specific field::'
)
print
(
''
)
print
(
' # curl {}/{}/{}'
.
format
(
API_URL
,
plugin
,
item
))
print
(
indent_stat
(
stat_item
))
print
(
''
)
if
item
and
value
and
stat
.
get_stats_value
(
item
,
value
):
print
(
'Get a specific item when field matchs the given value::'
)
print
(
''
)
print
(
' # curl {}/{}/{}/{}'
.
format
(
API_URL
,
plugin
,
item
,
value
))
print
(
indent_stat
(
json
.
loads
(
stat
.
get_stats_value
(
item
,
value
))))
print
(
''
)
...
...
@@ -128,6 +128,7 @@ def print_all():
print
(
'-'
*
len
(
sub_title
))
print
(
''
)
print
(
'Get all Glances stats::'
)
print
(
''
)
print
(
' # curl {}/all'
.
format
(
API_URL
))
print
(
' Return a very big dictionnary (avoid using this request, performances will be poor)...'
)
print
(
''
)
...
...
@@ -143,18 +144,22 @@ def print_history(stats):
print
(
'-'
*
len
(
sub_title
))
print
(
''
)
print
(
'History of a plugin::'
)
print
(
''
)
print
(
' # curl {}/cpu/history'
.
format
(
API_URL
))
print
(
indent_stat
(
json
.
loads
(
stats
.
get_plugin
(
'cpu'
).
get_stats_history
(
nb
=
3
))))
print
(
''
)
print
(
'Limit history to last 2 values::'
)
print
(
''
)
print
(
' # curl {}/cpu/history/2'
.
format
(
API_URL
))
print
(
indent_stat
(
json
.
loads
(
stats
.
get_plugin
(
'cpu'
).
get_stats_history
(
nb
=
2
))))
print
(
''
)
print
(
'History for a specific field::'
)
print
(
''
)
print
(
' # curl {}/cpu/system/history'
.
format
(
API_URL
))
print
(
indent_stat
(
json
.
loads
(
stats
.
get_plugin
(
'cpu'
).
get_stats_history
(
'system'
))))
print
(
''
)
print
(
'Limit history for a specific field to last 2 values::'
)
print
(
''
)
print
(
' # curl {}/cpu/system/history'
.
format
(
API_URL
))
print
(
indent_stat
(
json
.
loads
(
stats
.
get_plugin
(
'cpu'
).
get_stats_history
(
'system'
,
nb
=
2
))))
print
(
''
)
...
...
@@ -166,10 +171,12 @@ def print_limits(stats):
print
(
'-'
*
len
(
sub_title
))
print
(
''
)
print
(
'All limits/thresholds::'
)
print
(
''
)
print
(
' # curl {}/all/limits'
.
format
(
API_URL
))
print
(
indent_stat
(
stats
.
getAllLimitsAsDict
()))
print
(
''
)
print
(
'Limits/thresholds for the cpu plugin::'
)
print
(
''
)
print
(
' # curl {}/cpu/limits'
.
format
(
API_URL
))
print
(
indent_stat
(
stats
.
get_plugin
(
'cpu'
).
limits
))
print
(
''
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录