From 9157bb8fe8daa6a85989e012dd8451c7f7d69d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santos?= Date: Wed, 7 Apr 2021 12:17:47 +0100 Subject: [PATCH 1/2] Configurable scheme to support https --- netdata/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netdata/__init__.py b/netdata/__init__.py index e8a3e96..72a82bc 100644 --- a/netdata/__init__.py +++ b/netdata/__init__.py @@ -22,7 +22,7 @@ class Netdata(object): """A class for handling connections with a Netdata instance.""" - def __init__(self, host, loop, session, port=19999, path=None): + def __init__(self, host, loop, session, scheme='http', port=19999, path=None): """Initialize the connection to the Netdata instance.""" self._loop = loop self._session = session @@ -30,9 +30,9 @@ def __init__(self, host, loop, session, port=19999, path=None): self.port = port self.values = self.alarms = self.metrics = None if path is None: - self.base_url = URL.build(scheme="http", host=host, port=port, path=f"/api/v{API_VERSION}/") + self.base_url = URL.build(scheme, host=host, port=port, path=f"/api/v{API_VERSION}/") else: - self.base_url = URL.build(scheme="http", host=host, port=port, path=path) + self.base_url = URL.build(scheme, host=host, port=port, path=path) async def get_data(self, resource): From dc9730df14d363f4cefc77fcfae295e9a0e383d0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 1 Jun 2023 01:14:59 +0200 Subject: [PATCH 2/2] Update style --- netdata/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netdata/__init__.py b/netdata/__init__.py index 72a82bc..4ba3904 100644 --- a/netdata/__init__.py +++ b/netdata/__init__.py @@ -22,7 +22,7 @@ class Netdata(object): """A class for handling connections with a Netdata instance.""" - def __init__(self, host, loop, session, scheme='http', port=19999, path=None): + def __init__(self, host, loop, session, scheme="http", port=19999, path=None): """Initialize the connection to the Netdata instance.""" self._loop = loop self._session = session