glances_api 0.4.0__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {glances_api-0.4.0 → glances_api-0.4.1}/PKG-INFO +1 -1
- {glances_api-0.4.0 → glances_api-0.4.1}/glances_api/__init__.py +13 -13
- {glances_api-0.4.0 → glances_api-0.4.1}/pyproject.toml +3 -3
- {glances_api-0.4.0 → glances_api-0.4.1}/setup.py +1 -1
- {glances_api-0.4.0 → glances_api-0.4.1}/LICENSE +0 -0
- {glances_api-0.4.0 → glances_api-0.4.1}/README.rst +0 -0
- {glances_api-0.4.0 → glances_api-0.4.1}/glances_api/exceptions.py +0 -0
|
@@ -61,22 +61,22 @@ class Glances:
|
|
|
61
61
|
raise exceptions.GlancesApiAuthorizationError(
|
|
62
62
|
"Please check your credentials"
|
|
63
63
|
)
|
|
64
|
-
|
|
64
|
+
|
|
65
|
+
if response.status_code != httpx.codes.OK:
|
|
65
66
|
raise exceptions.GlancesApiNoDataAvailable(
|
|
66
67
|
f"endpoint: '{endpoint}' is not valid"
|
|
67
68
|
)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
)
|
|
69
|
+
try:
|
|
70
|
+
_LOGGER.debug(response.json())
|
|
71
|
+
if endpoint == "all":
|
|
72
|
+
self.data = response.json()
|
|
73
|
+
elif endpoint == "pluginslist":
|
|
74
|
+
self.plugins = response.json()
|
|
75
|
+
except TypeError:
|
|
76
|
+
_LOGGER.error("Can not load data from Glances")
|
|
77
|
+
raise exceptions.GlancesApiConnectionError(
|
|
78
|
+
"Unable to get the data from Glances"
|
|
79
|
+
)
|
|
80
80
|
|
|
81
81
|
async def get_metrics(self, element: str) -> None:
|
|
82
82
|
"""Get all the metrics for a monitored element."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "glances_api"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.1"
|
|
4
4
|
description = "Python API for interacting with Glances"
|
|
5
5
|
authors = ["Fabian Affolter <fabian@affolter-engineering.ch>"]
|
|
6
6
|
homepage = "https://github.com/home-assistant-ecosystem/python-glances-api"
|
|
@@ -22,8 +22,8 @@ python = "^3.8"
|
|
|
22
22
|
httpx = ">=0.23,<1"
|
|
23
23
|
|
|
24
24
|
[tool.poetry.dev-dependencies]
|
|
25
|
-
black = "^22.
|
|
26
|
-
pytest = "^
|
|
25
|
+
black = "^22.6.0"
|
|
26
|
+
pytest = "^7.1.2"
|
|
27
27
|
pytest-httpx = ">0.15,<1"
|
|
28
28
|
pytest-asyncio = "^0.16.0"
|
|
29
29
|
isort = "^5.10.0"
|
|
@@ -12,7 +12,7 @@ install_requires = \
|
|
|
12
12
|
|
|
13
13
|
setup_kwargs = {
|
|
14
14
|
'name': 'glances-api',
|
|
15
|
-
'version': '0.4.
|
|
15
|
+
'version': '0.4.1',
|
|
16
16
|
'description': 'Python API for interacting with Glances',
|
|
17
17
|
'long_description': 'python-glances-api\n==================\n\nA Python client for interacting with `Glances <https://nicolargo.github.io/glances/>`_.\n\nThis module is not official, developed, supported or endorsed by Glances.\n\nInstallation\n------------\n\nThe module is available from the `Python Package Index <https://pypi.python.org/pypi>`_.\n\n.. code:: bash\n\n $ pip3 install glances_api\n\nOr on a Fedora-based system or on a CentOS/RHEL machine with has EPEL enabled.\n\n.. code:: bash\n\n $ sudo dnf -y install python3-glances-api\n\n\nFor Nix or NixOS is `pre-packed module <https://search.nixos.org/packages?channel=unstable&query=glances-api>`_\navailable. The lastest release is usually present in the ``unstable`` channel.\n\n.. code:: bash\n\n $ nix-env -iA nixos.python3Packages.glances-api\n\nUsage\n-----\n\nThe file ``example.py`` contains an example about how to use this module.\n\nLicense\n-------\n\n``python-glances-api`` is licensed under MIT, for more details check LICENSE.\n',
|
|
18
18
|
'author': 'Fabian Affolter',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|