Skip to content

Commit 3128814

Browse files
authored
Merge pull request #330 from beetanz/aws-html-emails
Update AWS parser for HTML emails
2 parents 86c0116 + 3f9e4e8 commit 3128814

File tree

15 files changed

+2633
-33
lines changed

15 files changed

+2633
-33
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Changelog
22

3-
# Changelog
4-
53
## v2.8.0 - 2025-06-06
64

75
### Added

changes/330.added

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for parsing AWS HTML format maintenance notification emails

circuit_maintenance_parser/parsers/aws.py

Lines changed: 1233 additions & 23 deletions
Large diffs are not rendered by default.

circuit_maintenance_parser/provider.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from circuit_maintenance_parser.parsers.apple import SubjectParserApple, TextParserApple
1818
from circuit_maintenance_parser.parsers.aquacomms import HtmlParserAquaComms1, SubjectParserAquaComms1
1919
from circuit_maintenance_parser.parsers.att import HtmlParserATT1, XlsxParserATT1
20-
from circuit_maintenance_parser.parsers.aws import SubjectParserAWS1, TextParserAWS1
20+
from circuit_maintenance_parser.parsers.aws import HtmlParserAWS1, SubjectParserAWS1, TextParserAWS1
2121
from circuit_maintenance_parser.parsers.bso import HtmlParserBSO1
2222
from circuit_maintenance_parser.parsers.cogent import HtmlParserCogent1, SubjectParserCogent1, TextParserCogent1
2323
from circuit_maintenance_parser.parsers.colt import CsvParserColt1, SubjectParserColt1, SubjectParserColt2
@@ -276,6 +276,7 @@ class AWS(GenericProvider):
276276

277277
_processors: List[GenericProcessor] = PrivateAttr(
278278
[
279+
CombinedProcessor(data_parsers=[HtmlParserAWS1]),
279280
CombinedProcessor(data_parsers=[EmailDateParser, TextParserAWS1, SubjectParserAWS1]),
280281
]
281282
)

tests/unit/data/aws/aws1_result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
],
3030
"end": 1621519200,
31-
"maintenance_id": "a81ca7da4301432e1542f67d34414c71e7ccb22d233a6d1b0a70a722b386f368",
31+
"maintenance_id": "b57f17ce354c1e0c8563f9cc0a75ac0c81f6672ffa6606a31a13ff4de2b383ae",
3232
"organizer": "[email protected]",
3333
"provider": "aws",
3434
"sequence": 1,

tests/unit/data/aws/aws1_text_parser_result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828
],
2929
"end": 1621519200,
30-
"maintenance_id": "a81ca7da4301432e1542f67d34414c71e7ccb22d233a6d1b0a70a722b386f368",
30+
"maintenance_id": "b57f17ce354c1e0c8563f9cc0a75ac0c81f6672ffa6606a31a13ff4de2b383ae",
3131
"start": 1621497600,
3232
"status": "CONFIRMED",
3333
"summary": "Planned maintenance has been scheduled on an AWS Direct Connect router in A Block, New York, NY from Thu, 20 May 2021 08:00:00 GMT to Thu, 20 May 2021 14:00:00 GMT for 6 hours. During this maintenance window, your AWS Direct Connect services listed below may become unavailable."

tests/unit/data/aws/aws2_result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}
2929
],
3030
"end": 1631584920,
31-
"maintenance_id": "6a01cfd83c1249d5f9a9c97de5232501794f37a8c15d433d09c029229f25659d",
31+
"maintenance_id": "db4caacefd12cfa63678029e330bff2dd7a964b98f730b04ee099d76751f0f3d",
3232
"organizer": "[email protected]",
3333
"provider": "aws",
3434
"sequence": 1,

tests/unit/data/aws/aws2_text_parser_result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828
],
2929
"end": 1631584920,
30-
"maintenance_id": "6a01cfd83c1249d5f9a9c97de5232501794f37a8c15d433d09c029229f25659d",
30+
"maintenance_id": "db4caacefd12cfa63678029e330bff2dd7a964b98f730b04ee099d76751f0f3d",
3131
"start": 1631559720,
3232
"status": "CANCELLED",
3333
"summary": "We would like to inform you that the planned maintenance that was scheduled for AWS Direct Connect endpoint in Equinix SG2, Singapore, SGP from Mon, 13 Sep 2021 19:02:00 GMT to Tue, 14 Sep 2021 02:02:00 GMT has been cancelled. Please find below your AWS Direct Connect services that would have been affected by this planned maintenance."

tests/unit/data/aws/aws3_result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"end": 1703055600,
19-
"maintenance_id": "065ad66cb4e401827f675a56799be7ceb9cd66fc180ee5878c54533f7f196b52",
19+
"maintenance_id": "387c99e743b96cf135b8e97d56c2dbbc02a0acda4eaf9637bcfeb23a7ebc96e2",
2020
"organizer": "[email protected]",
2121
"provider": "aws",
2222
"sequence": 1,

tests/unit/data/aws/aws3_text_parser_result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"end": 1703055600,
18-
"maintenance_id": "065ad66cb4e401827f675a56799be7ceb9cd66fc180ee5878c54533f7f196b52",
18+
"maintenance_id": "387c99e743b96cf135b8e97d56c2dbbc02a0acda4eaf9637bcfeb23a7ebc96e2",
1919
"start": 1703041200,
2020
"status": "CONFIRMED",
2121
"summary": "Emergency maintenance has been scheduled on an AWS Direct Connect endpoint in Datacenter Foo3, Anywhere, USA from Wed, 20 Dec 2023 03:00:00 GMT to Wed, 20 Dec 2023 07:00:00 GMT for 4 hours. This maintenance will cause a disruption to the following Direct Connect connections you own:"

0 commit comments

Comments
 (0)