From 551d54670d6b3e5891aea6803e2b4ae337406a10 Mon Sep 17 00:00:00 2001 From: Yufeng Xin Date: Mon, 13 Jan 2025 23:38:37 -0500 Subject: [PATCH 1/2] change the max_delay feasible on the topology --- src/sdx_datamodel/data/requests/test-l2vpn-p2p-v2.json | 2 +- .../data/requests/test-request-amlight_sax-p2p-v2.json | 2 +- .../data/requests/test_request-amlight_zaoxi-p2p-v2.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdx_datamodel/data/requests/test-l2vpn-p2p-v2.json b/src/sdx_datamodel/data/requests/test-l2vpn-p2p-v2.json index 22ff65e..827a2b6 100644 --- a/src/sdx_datamodel/data/requests/test-l2vpn-p2p-v2.json +++ b/src/sdx_datamodel/data/requests/test-l2vpn-p2p-v2.json @@ -22,7 +22,7 @@ "strict": true }, "max_delay": { - "value": 4, + "value": 50, "strict": false }, "max_number_oxps": { diff --git a/src/sdx_datamodel/data/requests/test-request-amlight_sax-p2p-v2.json b/src/sdx_datamodel/data/requests/test-request-amlight_sax-p2p-v2.json index 8940c2c..e565d94 100644 --- a/src/sdx_datamodel/data/requests/test-request-amlight_sax-p2p-v2.json +++ b/src/sdx_datamodel/data/requests/test-request-amlight_sax-p2p-v2.json @@ -22,7 +22,7 @@ "strict": true }, "max_delay": { - "value": 0, + "value": 50, "strict": false }, "max_number_oxps": { diff --git a/src/sdx_datamodel/data/requests/test_request-amlight_zaoxi-p2p-v2.json b/src/sdx_datamodel/data/requests/test_request-amlight_zaoxi-p2p-v2.json index 8503167..49dc03e 100644 --- a/src/sdx_datamodel/data/requests/test_request-amlight_zaoxi-p2p-v2.json +++ b/src/sdx_datamodel/data/requests/test_request-amlight_zaoxi-p2p-v2.json @@ -22,7 +22,7 @@ "strict": true }, "max_delay": { - "value": 4, + "value": 50, "strict": false }, "max_number_oxps": { From f972840888e0b3c54045dbc003558df4b837d9b2 Mon Sep 17 00:00:00 2001 From: Yufeng Xin Date: Tue, 14 Jan 2025 08:48:21 -0500 Subject: [PATCH 2/2] error message --- .../validation/connectionvalidator.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/sdx_datamodel/validation/connectionvalidator.py b/src/sdx_datamodel/validation/connectionvalidator.py index 351726a..e522a73 100644 --- a/src/sdx_datamodel/validation/connectionvalidator.py +++ b/src/sdx_datamodel/validation/connectionvalidator.py @@ -102,9 +102,13 @@ def _validate_qos_metrics_value(self, metric, value, max_value): errors = [] if not isinstance(value, int): - errors.append(f"{value} {metric} must be a number") + errors.append( + f"Strict QoS requirements: {value} {metric} must be a number" + ) if not (0 <= value <= max_value): - errors.append(f"{value} {metric} must be between 0 and 1000") + errors.append( + f"Strict QoS requirements: {value} {metric} must be between 0 and 1000" + ) return errors @@ -156,11 +160,11 @@ def _validate_time(self, start_time: str, end_time: str, conn: Connection): start_time = start_time_obj.replace(tzinfo=utc) if start_time < datetime.now().replace(tzinfo=utc): errors.append( - f"{start_time} start_time cannot be before the current time" + f"Scheduling not possible: {start_time} start_time cannot be before the current time" ) except ValueError: errors.append( - f"{start_time} start_time is not in a valid ISO format" + f"Scheduling not possible: {start_time} start_time is not in a valid ISO format" ) if end_time: try: @@ -171,11 +175,11 @@ def _validate_time(self, start_time: str, end_time: str, conn: Connection): or end_time < start_time ): errors.append( - f"{end_time} end_time cannot be before the current or start time" + f"Scheduling not possible: {end_time} end_time cannot be before the current or start time" ) except ValueError: errors.append( - f"{end_time} end_time is not in a valid ISO format" + f"Scheduling not possible: {end_time} end_time is not in a valid ISO format" ) return errors