Skip to content

Reject unsupported VLAN keyword “all” client-side and normalize “any” / “untagged” with consistent endpoint checks #496

Description

@lmarinve

Users attempting to create an L2VPN with VLAN "all" see inconsistent errors originating from different layers:
SDX Controller returns validation error:
Validation error: VLAN range all is invalid: all is not a number
Sometimes the API returns:
All endpoints must have the same VLAN value if one uses 'any', 'all', or 'untagged'.
In other cases:
Request does not have a valid JSON or body is incomplete/incorrect

Expected
sdx-lib validates VLAN values before calling the SDX Controller.
"all" is rejected client-side with a clear message (and guidance), since Controller does not support it.
If "any" or "untagged" is used, sdx-lib guarantees all endpoints share the same VLAN keyword and produces a single, consistent error if they do not.

Actual
Mixed server-side errors; confusing UX.

cURL equivalent payload

{
"endpoints": [
{"port_id": "urn:sdx:port:amlight.net:MIA-MI1-SW17:7", "vlan": "all"},
{"port_id": "urn:sdx:port:amlight.net:MIA-MI1-SW18:8", "vlan": "all"}
],
"name": "EPL test",
"notifications": [{"email": "absahin@fiu.edu"}]
}

Scope
Input validation layer in sdx-lib for L2VPN creation.
Error normalization & messages returned to callers (Flask UI/Swagger).

Acceptance criteria
"all" rejected client-side with message:
“VLAN value ‘all’ is not supported by the SDX-Controller.
Use an explicit VLAN ID or ‘any’/‘untagged’ (consistently across endpoints).”

If "any" or "untagged" is used on one endpoint, sdx-lib enforces the same on all endpoints; otherwise, a single consistent client-side error is returned.

Add unit + e2e tests covering: explicit ID, any, untagged, and rejection of all.

Case EP1 VLAN EP2 VLAN Expected
1 123 123 success
2 any any success
3 untagged untagged success (if both ports support it)
4 any 123 client-side error (keyword mismatch)
5 untagged any client-side error (keyword mismatch)
6 all all client-side error: unsupported
7 all 123 client-side error: unsupported + mismatch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions