teams-alerter 0.1.5__py3-none-any.whl → 0.1.7__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.
teams_alerter/core.py CHANGED
@@ -41,16 +41,18 @@ class TeamsAlerter:
41
41
 
42
42
  def publish_alert(self):
43
43
  # Formatage du payload
44
- utc_timestamp_minus_5min = DateUtils.get_str_utc_timestamp_minus_5min()
45
44
  utc_timestamp = DateUtils.get_str_utc_timestamp()
45
+ utc_timestamp_minus_5min = DateUtils.get_str_utc_timestamp_minus_5min()
46
+ utc_timestamp_plus_5min = DateUtils.get_str_utc_timestamp_plus_5min()
47
+
46
48
  payload = json.dumps(
47
49
  {
48
50
  "app_name": self.utils["app_name"],
49
- "teams_channel": self.utils["teams_chanel"],
51
+ "teams_channel": self.utils["teams_channel"],
50
52
  "detail": self.detail,
51
53
  "level": self.level,
52
54
  "environment": self.utils["env"],
53
- "url_log": f"https://console.cloud.google.com/logs/query;cursorTimestamp={utc_timestamp_minus_5min};duration=PT10M?referrer=search&hl=fr&inv=1&invt=Ab5Wpw&project={self.utils['app_project_id']}",
55
+ "url_log": f"https://console.cloud.google.com/logs/query;cursorTimestamp={utc_timestamp};startTime={utc_timestamp_minus_5min};endTime={utc_timestamp_plus_5min}?referrer=search&hl=fr&inv=1&invt=Ab5Y1Q&project={self.utils['app_project_id']}",
54
56
  "timestamp": utc_timestamp,
55
57
  "teams_template": "card",
56
58
  }
teams_alerter/utils.py CHANGED
@@ -11,7 +11,7 @@ class ErrorUtils(TypedDict):
11
11
  topic_project_id: str
12
12
  topic_id: str
13
13
  app_name: str
14
- teams_chanel: str
14
+ teams_channel: str
15
15
 
16
16
 
17
17
  class DateUtils:
@@ -24,3 +24,8 @@ class DateUtils:
24
24
  def get_str_utc_timestamp_minus_5min():
25
25
  dt = datetime.datetime.utcnow() - datetime.timedelta(minutes=5)
26
26
  return dt.strftime("%Y-%m-%dT%H:%M:%S") + ".000000000Z"
27
+
28
+ @staticmethod
29
+ def get_str_utc_timestamp_plus_5min():
30
+ dt = datetime.datetime.utcnow() + datetime.timedelta(minutes=5)
31
+ return dt.strftime("%Y-%m-%dT%H:%M:%S") + ".000000000Z"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: teams-alerter
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: Module pour envoyer des alertes Teams via Pub/Sub
5
5
  Author-email: Toki <t.bakotondrabe-ext@paris-turf.com>
6
6
  License: MIT
@@ -0,0 +1,7 @@
1
+ teams_alerter/__init__.py,sha256=J6zyyTfUNVElXD0wsTqBwp-VtcApbzYGUPpChrdcbpY,131
2
+ teams_alerter/core.py,sha256=VVDeIinTjTVFWwJbbRj2DDzzl7qHvjlRd5Q5m3JBmfY,2564
3
+ teams_alerter/utils.py,sha256=FIv5LaU7Ff4mB9PRvYILCq3DJJKDImbgDx_pCTGbp9k,861
4
+ teams_alerter-0.1.7.dist-info/METADATA,sha256=Nm3-cuxodc_uFSp1HN2-dLHSLBbrlOXpNj6RlwUTukw,2194
5
+ teams_alerter-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ teams_alerter-0.1.7.dist-info/top_level.txt,sha256=Qt8-VgHT7YPTbMzYkAomK9itC-w4YpV7IJ5X6b-TC-4,14
7
+ teams_alerter-0.1.7.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- teams_alerter/__init__.py,sha256=J6zyyTfUNVElXD0wsTqBwp-VtcApbzYGUPpChrdcbpY,131
2
- teams_alerter/core.py,sha256=pZ0mxpKKILt2HasgdI4dGUrM0E3TT93nmt2OmLUTJGI,2437
3
- teams_alerter/utils.py,sha256=moWLo0iPC-Gkq5jpo99j1ikpnwF3m9hAGX3AgL_6w90,657
4
- teams_alerter-0.1.5.dist-info/METADATA,sha256=wlLLa9A5wQP-XZ-kzmKDRTYHUhh5ihkG6fxSA9482Xw,2194
5
- teams_alerter-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- teams_alerter-0.1.5.dist-info/top_level.txt,sha256=Qt8-VgHT7YPTbMzYkAomK9itC-w4YpV7IJ5X6b-TC-4,14
7
- teams_alerter-0.1.5.dist-info/RECORD,,