File: restful.rst

package info (click to toggle)
glances 3.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,944 kB
  • sloc: javascript: 26,103; python: 11,238; makefile: 229; sh: 169
file content (42 lines) | stat: -rw-r--r-- 845 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.. _restful:

RESTful
=======

You can export statistics to a ``RESTful`` JSON server. All the available stats
will be exported in one big (~15 KB) POST request to the RESTful endpoint.

The RESTful endpoint should be defined in the Glances configuration file as
following:

.. code-block:: ini

    [restful]
    # Configuration for the --export-restful option
    # Example, export to http://localhost:6789/
    host=localhost
    port=6789
    protocol=http
    path=/

URL Syntax:

.. code-block:: ini

    http://localhost:6789/
    |      |         |   |
    |      |         |   path
    |      |         port
    |      host
    protocol

and run Glances with:

.. code-block:: console

    $ glances --export restful

Glances will generate stats as a big JSON dictionary (see example `here`_).


.. _here: https://pastebin.com/7U3vXqvF