teams-alerter 0.1.6__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 +4 -2
- teams_alerter/utils.py +5 -0
- {teams_alerter-0.1.6.dist-info → teams_alerter-0.1.7.dist-info}/METADATA +1 -1
- teams_alerter-0.1.7.dist-info/RECORD +7 -0
- teams_alerter-0.1.6.dist-info/RECORD +0 -7
- {teams_alerter-0.1.6.dist-info → teams_alerter-0.1.7.dist-info}/WHEEL +0 -0
- {teams_alerter-0.1.6.dist-info → teams_alerter-0.1.7.dist-info}/top_level.txt +0 -0
teams_alerter/core.py
CHANGED
@@ -41,8 +41,10 @@ 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"],
|
@@ -50,7 +52,7 @@ class TeamsAlerter:
|
|
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};
|
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
@@ -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"
|
@@ -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=l1tFzb3NZbNm_U_SdEgQbH2fONrGFuu1UIUZrCU6ZmU,2438
|
3
|
-
teams_alerter/utils.py,sha256=eXuuoC5JU_N2A2ieK7AcBK6_PnZBg6A4PsE3LwcO4e4,658
|
4
|
-
teams_alerter-0.1.6.dist-info/METADATA,sha256=4gWhj87AXfejEihwnjpGOJ1R1z6fMSiPejhyjlEgX40,2194
|
5
|
-
teams_alerter-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
6
|
-
teams_alerter-0.1.6.dist-info/top_level.txt,sha256=Qt8-VgHT7YPTbMzYkAomK9itC-w4YpV7IJ5X6b-TC-4,14
|
7
|
-
teams_alerter-0.1.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|