Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the max_delay feasible on the topology #159

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/sdx_datamodel/data/requests/test-l2vpn-p2p-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"strict": true
},
"max_delay": {
"value": 4,
"value": 50,
"strict": false
},
"max_number_oxps": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"strict": true
},
"max_delay": {
"value": 0,
"value": 50,
"strict": false
},
"max_number_oxps": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"strict": true
},
"max_delay": {
"value": 4,
"value": 50,
"strict": false
},
"max_number_oxps": {
Expand Down
16 changes: 10 additions & 6 deletions src/sdx_datamodel/validation/connectionvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
Loading