.. _api:
API (Restfull/JSON) documentation
=================================
The Glances Restfull/API server could be ran using the following command line:
.. code-block:: bash
# glances -w --disable-webui
Note: Change request URL api/3 by api/2 if you use Glances 2.x.
GET API status
--------------
This entry point should be used to check the API status.
It will return nothing but a 200 return code if everythin is OK.
Get the Rest API status::
# curl -I http://localhost:61208/api/3/status
'HTTP/1.0 200 OK'
GET plugins list
----------------
Get the plugins list::
# curl http://localhost:61208/api/3/pluginslist
['alert',
'amps',
'cloud',
'connections',
'core',
'cpu',
'diskio',
'docker',
'folders',
'fs',
'gpu',
'help',
'ip',
'irq',
'load',
'mem',
'memswap',
'network',
'now',
'percpu',
'ports',
'processcount',
'processlist',
'psutilversion',
'quicklook',
'raid',
'sensors',
'smart',
'system',
'uptime',
'wifi']
GET alert
---------
Get plugin stats::
# curl http://localhost:61208/api/3/alert
[[1649600032.0,
-1,
'WARNING',
'MEM',
87.2703077870435,
87.2703077870435,
87.2703077870435,
87.2703077870435,
1,
[],
'',
'memory_percent']]
GET amps
--------
Get plugin stats::
# curl http://localhost:61208/api/3/amps
[{'count': 0,
'countmax': None,
'countmin': 1.0,
'key': 'name',
'name': 'Dropbox',
'refresh': 3.0,
'regex': True,
'result': None,
'timer': 0.14095854759216309},
{'count': 0,
'countmax': 20.0,
'countmin': None,
'key': 'name',
'name': 'Python',
'refresh': 3.0,
'regex': True,
'result': None,
'timer':