glances_api 0.3.2__tar.gz → 0.3.3__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.3.2 → glances_api-0.3.3}/PKG-INFO +1 -1
- {glances_api-0.3.2 → glances_api-0.3.3}/glances_api/__init__.py +3 -3
- {glances_api-0.3.2 → glances_api-0.3.3}/pyproject.toml +3 -3
- {glances_api-0.3.2 → glances_api-0.3.3}/setup.py +1 -1
- {glances_api-0.3.2 → glances_api-0.3.3}/LICENSE +0 -0
- {glances_api-0.3.2 → glances_api-0.3.3}/README.rst +0 -0
- {glances_api-0.3.2 → glances_api-0.3.3}/glances_api/exceptions.py +0 -0
|
@@ -19,6 +19,7 @@ class Glances(object):
|
|
|
19
19
|
port=61208,
|
|
20
20
|
version=2,
|
|
21
21
|
ssl=False,
|
|
22
|
+
verify_ssl=True,
|
|
22
23
|
username=None,
|
|
23
24
|
password=None,
|
|
24
25
|
):
|
|
@@ -31,13 +32,14 @@ class Glances(object):
|
|
|
31
32
|
self.values = None
|
|
32
33
|
self.username = username
|
|
33
34
|
self.password = password
|
|
35
|
+
self.verify_ssl = verify_ssl
|
|
34
36
|
|
|
35
37
|
async def get_data(self, endpoint):
|
|
36
38
|
"""Retrieve the data."""
|
|
37
39
|
url = "{}/{}".format(self.url, endpoint)
|
|
38
40
|
|
|
39
41
|
try:
|
|
40
|
-
async with httpx.AsyncClient() as client:
|
|
42
|
+
async with httpx.AsyncClient(verify=self.verify_ssl) as client:
|
|
41
43
|
if self.password is None:
|
|
42
44
|
response = await client.get(str(url))
|
|
43
45
|
else:
|
|
@@ -55,8 +57,6 @@ class Glances(object):
|
|
|
55
57
|
if response.status_code == httpx.codes.OK:
|
|
56
58
|
try:
|
|
57
59
|
_LOGGER.debug(response.json())
|
|
58
|
-
# print(self.data)
|
|
59
|
-
# self.data = response.json()
|
|
60
60
|
if endpoint == "all":
|
|
61
61
|
self.data = response.json()
|
|
62
62
|
if endpoint == "pluginslist":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "glances_api"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.3"
|
|
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,9 +22,9 @@ python = "^3.8"
|
|
|
22
22
|
httpx = ">=0.20,<1"
|
|
23
23
|
|
|
24
24
|
[tool.poetry.dev-dependencies]
|
|
25
|
-
black = "^21.
|
|
25
|
+
black = "^21.12b0"
|
|
26
26
|
pytest = "^6.2.5"
|
|
27
|
-
pytest-httpx = "
|
|
27
|
+
pytest-httpx = ">0.15,<1"
|
|
28
28
|
pytest-asyncio = "^0.16.0"
|
|
29
29
|
isort = "^5.10.0"
|
|
30
30
|
|
|
@@ -12,7 +12,7 @@ install_requires = \
|
|
|
12
12
|
|
|
13
13
|
setup_kwargs = {
|
|
14
14
|
'name': 'glances-api',
|
|
15
|
-
'version': '0.3.
|
|
15
|
+
'version': '0.3.3',
|
|
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\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
|