mirror of
https://github.com/tiqi-group/pydase_service_base.git
synced 2026-01-16 17:39:25 +01:00
feat: adds verify_ssl to InfluxDBSession (v2)
This commit is contained in:
@@ -29,6 +29,7 @@ class InfluxDBConfig(BaseConfig): # type: ignore
|
||||
url: str
|
||||
org: str
|
||||
token: SecretStr
|
||||
verify_ssl: bool = True
|
||||
headers: dict[str, str] = {} # noqa: RUF012
|
||||
|
||||
|
||||
|
||||
@@ -81,12 +81,15 @@ class InfluxDBSession:
|
||||
self.token = self._config.token.get_secret_value()
|
||||
self.org = self._config.org
|
||||
self.headers = self._config.headers
|
||||
self.verify_ssl = self._config.verify_ssl
|
||||
self._client: InfluxDBClient
|
||||
self._write_api: WriteApi
|
||||
self._buckets_api: BucketsApi
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
self._client = InfluxDBClient(url=self.url, token=self.token, org=self.org)
|
||||
self._client = InfluxDBClient(
|
||||
url=self.url, token=self.token, org=self.org, verify_ssl=self.verify_ssl
|
||||
)
|
||||
|
||||
for header_name, header_value in self.headers.items():
|
||||
self._client.api_client.set_default_header(header_name, header_value)
|
||||
|
||||
Reference in New Issue
Block a user