Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,257 changes: 1,235 additions & 22 deletions circuit_maintenance_parser/parsers/aws.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion circuit_maintenance_parser/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from circuit_maintenance_parser.parsers.apple import SubjectParserApple, TextParserApple
from circuit_maintenance_parser.parsers.aquacomms import HtmlParserAquaComms1, SubjectParserAquaComms1
from circuit_maintenance_parser.parsers.att import HtmlParserATT1, XlsxParserATT1
from circuit_maintenance_parser.parsers.aws import SubjectParserAWS1, TextParserAWS1
from circuit_maintenance_parser.parsers.aws import HtmlParserAWS1, SubjectParserAWS1, TextParserAWS1
from circuit_maintenance_parser.parsers.bso import HtmlParserBSO1
from circuit_maintenance_parser.parsers.cogent import HtmlParserCogent1, SubjectParserCogent1, TextParserCogent1
from circuit_maintenance_parser.parsers.colt import CsvParserColt1, SubjectParserColt1, SubjectParserColt2
Expand Down Expand Up @@ -251,6 +251,7 @@ class AWS(GenericProvider):

_processors: List[GenericProcessor] = PrivateAttr(
[
CombinedProcessor(data_parsers=[HtmlParserAWS1]),
CombinedProcessor(data_parsers=[EmailDateParser, TextParserAWS1, SubjectParserAWS1]),
]
)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/aws/aws1_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
],
"end": 1621519200,
"maintenance_id": "a81ca7da4301432e1542f67d34414c71e7ccb22d233a6d1b0a70a722b386f368",
"maintenance_id": "b57f17ce354c1e0c8563f9cc0a75ac0c81f6672ffa6606a31a13ff4de2b383ae",
"organizer": "[email protected]",
"provider": "aws",
"sequence": 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/aws/aws1_text_parser_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
],
"end": 1621519200,
"maintenance_id": "a81ca7da4301432e1542f67d34414c71e7ccb22d233a6d1b0a70a722b386f368",
"maintenance_id": "b57f17ce354c1e0c8563f9cc0a75ac0c81f6672ffa6606a31a13ff4de2b383ae",
"start": 1621497600,
"status": "CONFIRMED",
"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."
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/aws/aws2_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
],
"end": 1631584920,
"maintenance_id": "6a01cfd83c1249d5f9a9c97de5232501794f37a8c15d433d09c029229f25659d",
"maintenance_id": "db4caacefd12cfa63678029e330bff2dd7a964b98f730b04ee099d76751f0f3d",
"organizer": "[email protected]",
"provider": "aws",
"sequence": 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/aws/aws2_text_parser_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
],
"end": 1631584920,
"maintenance_id": "6a01cfd83c1249d5f9a9c97de5232501794f37a8c15d433d09c029229f25659d",
"maintenance_id": "db4caacefd12cfa63678029e330bff2dd7a964b98f730b04ee099d76751f0f3d",
"start": 1631559720,
"status": "CANCELLED",
"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."
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/aws/aws3_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"end": 1703055600,
"maintenance_id": "065ad66cb4e401827f675a56799be7ceb9cd66fc180ee5878c54533f7f196b52",
"maintenance_id": "387c99e743b96cf135b8e97d56c2dbbc02a0acda4eaf9637bcfeb23a7ebc96e2",
"organizer": "[email protected]",
"provider": "aws",
"sequence": 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/aws/aws3_text_parser_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"end": 1703055600,
"maintenance_id": "065ad66cb4e401827f675a56799be7ceb9cd66fc180ee5878c54533f7f196b52",
"maintenance_id": "387c99e743b96cf135b8e97d56c2dbbc02a0acda4eaf9637bcfeb23a7ebc96e2",
"start": 1703041200,
"status": "CONFIRMED",
"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:"
Expand Down
1,307 changes: 1,307 additions & 0 deletions tests/unit/data/aws/aws4.eml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions tests/unit/data/aws/aws4_html_parser_result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"account": "111111111111",
"circuits": [
{
"circuit_id": "dxcon-abc12345",
"impact": "OUTAGE"
},
{
"circuit_id": "dxvif-1234hfjd",
"impact": "OUTAGE"
},
{
"circuit_id": "dxlag-fge11110",
"impact": "OUTAGE"
},
{
"circuit_id": "dxcon-ffucoreh",
"impact": "OUTAGE"
},
{
"circuit_id": "dxcon-fg885ug5",
"impact": "OUTAGE"
}
],
"end": 1757998800,
"maintenance_id": "369a433f3071c0837b379bc170d410e35a7a733d61c2efaf51bd95a3a4073d71",
"start": 1757984400,
"stamp": 1756771998,
"status": "CONFIRMED",
"summary": "Hello, Planned maintenance has been scheduled on an AWS Direct Connect endpoint in Sonda Quilicura, Santiago from Tue, 16 Sep 2025 01:00:00 GMT to Tue, 16 Sep 2025 05:00:00 GMT for 4 hours. During this maintenance window, your AWS Direct Connect services listed below may become unavailable. dxcon-abc12345 dxvif-1234hfjd dxlag-fge11110 dxcon-ffucoreh dxcon-fg885ug5 This maintenance is scheduled to avoid disrupting redundant connections at the same time. If you encounter any problems with your connection after the end of this maintenance window, please contact AWS Support[1]."
}
]
36 changes: 36 additions & 0 deletions tests/unit/data/aws/aws4_result.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[
{
"account": "111111111111",
"circuits": [
{
"circuit_id": "dxcon-abc12345",
"impact": "OUTAGE"
},
{
"circuit_id": "dxvif-1234hfjd",
"impact": "OUTAGE"
},
{
"circuit_id": "dxlag-fge11110",
"impact": "OUTAGE"
},
{
"circuit_id": "dxcon-ffucoreh",
"impact": "OUTAGE"
},
{
"circuit_id": "dxcon-fg885ug5",
"impact": "OUTAGE"
}
],
"end": 1757998800,
"maintenance_id": "369a433f3071c0837b379bc170d410e35a7a733d61c2efaf51bd95a3a4073d71",
"start": 1757984400,
"organizer": "[email protected]",
"provider": "aws",
"sequence": 1,
"stamp": 1756771998,
"status": "CONFIRMED",
"summary": "Hello, Planned maintenance has been scheduled on an AWS Direct Connect endpoint in Sonda Quilicura, Santiago from Tue, 16 Sep 2025 01:00:00 GMT to Tue, 16 Sep 2025 05:00:00 GMT for 4 hours. During this maintenance window, your AWS Direct Connect services listed below may become unavailable. dxcon-abc12345 dxvif-1234hfjd dxlag-fge11110 dxcon-ffucoreh dxcon-fg885ug5 This maintenance is scheduled to avoid disrupting redundant connections at the same time. If you encounter any problems with your connection after the end of this maintenance window, please contact AWS Support[1]."
}
]
9 changes: 9 additions & 0 deletions tests/unit/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@
Path(dir_path, "data", "aws", "aws3_result.json"),
],
),
(
AWS,
[
("html", Path(dir_path, "data", "aws", "aws4.eml")),
],
[
Path(dir_path, "data", "aws", "aws4_result.json"),
],
),
# BSO
(
BSO,
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from circuit_maintenance_parser.parsers.apple import TextParserApple
from circuit_maintenance_parser.parsers.aquacomms import HtmlParserAquaComms1, SubjectParserAquaComms1
from circuit_maintenance_parser.parsers.att import HtmlParserATT1, XlsxParserATT1
from circuit_maintenance_parser.parsers.aws import SubjectParserAWS1, TextParserAWS1
from circuit_maintenance_parser.parsers.aws import HtmlParserAWS1, SubjectParserAWS1, TextParserAWS1
from circuit_maintenance_parser.parsers.bso import HtmlParserBSO1
from circuit_maintenance_parser.parsers.cogent import HtmlParserCogent1
from circuit_maintenance_parser.parsers.colt import CsvParserColt1, SubjectParserColt1, SubjectParserColt2
Expand Down Expand Up @@ -170,6 +170,11 @@ def default(self, o):
Path(dir_path, "data", "aws", "aws3.eml"),
Path(dir_path, "data", "aws", "aws3_text_parser_result.json"),
),
(
HtmlParserAWS1,
Path(dir_path, "data", "aws", "aws4.eml"),
Path(dir_path, "data", "aws", "aws4_html_parser_result.json"),
),
# BSO
(
HtmlParserBSO1,
Expand Down
Loading