/usr/share/cagefs-skeleton/lib/python3.9/site-packages/glances/outputs/__pycache__
a ���c� � @ s� d Z ddlmZ ddlZddlZddlmZ ddlmZ dZ dZ dd d �Zdd� Zd d� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� ZG dd� de�ZdS )z#Fields description interface class.� )�pformatN)�logger)� iteritemszhttp://localhost:61208/api/3a .. _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. � c C sp t | t�rLt| �dkrLt | d t�rL|t| dd� ��dd| ��dd� S |t| ��dd| ��dd� S d S )N� r � � �'�")� isinstance�list�len�dictr �replace)�stat�indent� r �I/usr/lib/python3.9/site-packages/glances/outputs/glances_stdout_apidoc.py�indent_stat% s $(r c C sr d} t | � t dt| � � t d� t d� t d� t d� t d� t d� t d�t�� t td�� t d� d S ) NzGET API status�-� z8This entry point should be used to check the API status.z@It will return nothing but a 200 return code if everythin is OK.zGet the Rest API status::z # curl -I {}/statuszHTTP/1.0 200 OK��printr �format�API_URLr �� sub_titler r r �print_api_status. s r c C sZ d}t |� t dt|� � t d� t d� t d� t d�t�� t t| �� t d� d S )NzGET plugins listr r zGet the plugins list::z # curl {}/pluginslistr )r r r r r �print_plugins_list= s r c C sl d� | �}t|� tdt|� � td� td� td� td� t| �� ttt�|�� ��� td� d S )NzGET {}r r zGet plugin stats::z # curl {}/{})r r r r r �json�loadsZ get_stats)�pluginr r r r r �print_plugin_statsI s r"