arpakitlib 1.8.35__py3-none-any.whl → 1.8.36__py3-none-any.whl

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.
@@ -20,7 +20,7 @@ class ZabbixApiClient:
20
20
  api_url: str,
21
21
  api_user: str,
22
22
  api_password: str,
23
- timeout: float = timedelta(seconds=15).total_seconds()
23
+ timeout: float | int | timedelta = timedelta(seconds=15).total_seconds()
24
24
  ):
25
25
  self._logger = logging.getLogger(self.__class__.__name__)
26
26
 
@@ -33,7 +33,15 @@ class ZabbixApiClient:
33
33
  raise_for_type(api_password, str)
34
34
  self.api_password = api_password
35
35
 
36
- self.zabbix_api = ZabbixAPI(server=self.api_url, timeout=timeout)
36
+ if isinstance(timeout, float):
37
+ timeout = timedelta(timeout)
38
+ elif isinstance(timeout, int):
39
+ timeout = timedelta(timeout)
40
+ elif isinstance(timeout, timedelta):
41
+ pass
42
+ else:
43
+ raise_for_type(timeout, timedelta)
44
+ self.zabbix_api = ZabbixAPI(server=self.api_url, timeout=timeout.total_seconds())
37
45
 
38
46
  def login(self) -> Self:
39
47
  self.zabbix_api.login(user=self.api_user, password=self.api_password)
@@ -99,7 +107,7 @@ class ZabbixApiClient:
99
107
  kwargs["sortfield"] = "itemid"
100
108
  kwargs["sortorder"] = "DESC"
101
109
  itemid_ids = self.zabbix_api.item.get(**kwargs)
102
- res = [host_id["itemid"] for host_id in itemid_ids]
110
+ res = [d["itemid"] for d in itemid_ids]
103
111
  return res
104
112
 
105
113
  def get_items(
@@ -184,6 +192,9 @@ class ZabbixApiClient:
184
192
  return histories
185
193
 
186
194
 
195
+ ZabbixAPIClient = ZabbixApiClient
196
+
197
+
187
198
  def __example():
188
199
  pass
189
200
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.8.35
3
+ Version: 1.8.36
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -357,9 +357,9 @@ arpakitlib/ar_str_util.py,sha256=RIaSNA4nBDhJjQqg3KzULo6OnGUfE2uIqBAHCv3ahLE,384
357
357
  arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
358
358
  arpakitlib/ar_wata_api_client.py,sha256=gdHOqDbuqxhTjVDtRW1DvkRJLdDofCrOq51GTctzLns,242
359
359
  arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
360
- arpakitlib/ar_zabbix_api_client_util.py,sha256=Q-VR4MvoZ9aHwZeYZr9G3LwN-ANx1T5KFmF6pvPM-9M,6402
361
- arpakitlib-1.8.35.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
362
- arpakitlib-1.8.35.dist-info/METADATA,sha256=Xr542pGeITbamcRcWnHqa0O79Vc86xtTi6KC0sIilWQ,3477
363
- arpakitlib-1.8.35.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
364
- arpakitlib-1.8.35.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
365
- arpakitlib-1.8.35.dist-info/RECORD,,
360
+ arpakitlib/ar_zabbix_api_client_util.py,sha256=VYhYfwYm66ZCa0SCiGpdgROKzZlI_YyaQGDiehDrbtQ,6743
361
+ arpakitlib-1.8.36.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
362
+ arpakitlib-1.8.36.dist-info/METADATA,sha256=x7ju4r052R4jyt2b-5yhOmNRZmcmTrlV8cjEUEu0cvs,3477
363
+ arpakitlib-1.8.36.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
364
+ arpakitlib-1.8.36.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
365
+ arpakitlib-1.8.36.dist-info/RECORD,,