diff options
Diffstat (limited to 'glances/outputs/glances_stdout_apidoc.py')
-rw-r--r-- | glances/outputs/glances_stdout_apidoc.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/glances/outputs/glances_stdout_apidoc.py b/glances/outputs/glances_stdout_apidoc.py index ed9c2da1..c02af535 100644 --- a/glances/outputs/glances_stdout_apidoc.py +++ b/glances/outputs/glances_stdout_apidoc.py @@ -13,10 +13,12 @@ from pprint import pformat import json import time +from glances.outputs.glances_restful_api import GlancesRestfulApi from glances.logger import logger from glances.globals import iteritems -API_URL = "http://localhost:61208/api/3" + +API_URL = "http://localhost:61208/api/{api_version}".format(api_version=GlancesRestfulApi.API_VERSION) APIDOC_HEADER = """\ .. _api: @@ -33,12 +35,14 @@ The Glances Restfull/API server could be ran using the following command line: API URL ------- -The default root API URL is ``http://localhost:61208/api/3``. +The default root API URL is ``http://localhost:61208/api/{api_version}``. The bind address and port could be changed using the ``--bind`` and ``--port`` command line options. It is also possible to define an URL prefix using the ``url_prefix`` option from the [outputs] section -of the Glances configuration file. The url_prefix should always end with a slash (``/``). +of the Glances configuration file. + +Note: The url_prefix should always end with a slash (``/``). For example: @@ -46,10 +50,16 @@ For example: [outputs] url_prefix = /glances/ -will change the root API URL to ``http://localhost:61208/glances/api/3`` and the Web UI URL to +will change the root API URL to ``http://localhost:61208/glances/api/{api_version}`` and the Web UI URL to ``http://localhost:61208/glances/`` -""" +Web UI refresh +-------------- + +It is possible to change the Web UI refresh rate (default is 2 seconds) using the following option in the URL: +``http://localhost:61208/glances/?refresh=5`` + +""".format(api_version=GlancesRestfulApi.API_VERSION) def indent_stat(stat, indent=' '): @@ -67,7 +77,7 @@ def print_api_status(): print('-' * len(sub_title)) print('') print('This entry point should be used to check the API status.') - print('It will return nothing but a 200 return code if everything is OK.') + print('It will the Glances version and a 200 return code if everything is OK.') print('') print('Get the Rest API status::') print('') |