atlanticwave-sdx / sdx-controller

Central Controller for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
MIT License
2 stars 3 forks source link

PATCH is deleting connection on invalid request body #334

Open usmanazFIU opened 1 month ago

usmanazFIU commented 1 month ago

l2vpn connection gets deleted if there is a missing attribute in the request body. for instance if vlan attribute is missing from endpoints object

mahidhar1g commented 1 month ago

HI @congwang09, From what I observed, when creating a patch request with some wrong attributes or values, the connection is getting deleted.

For example, I used this post-request structure according to the specification to create a new connection { "name": "fabrictest1", "endpoints": [ { "id": "urn:sdx:port:ampath.net:Novi03:1", "name": "urn:sdx:port:ampath.net:Novi03:1", "vlan": "100" }, { "id": "urn:sdx:port:tenet.ac.za:Novi07:1", "name": "urn:sdx:port:tenet.ac.za:Novi07:1", "vlan": "100" } ] }

But when I do a patch request, and for instance if I remove one endpoint, it deletes the entire connection {"name":"fabric test","endpoints":[{"id":"urn:sdx:port:ampath.net:Novi02:4","name":"urn:sdx:port:ampath.net:Novi02:4","vlan":"any"}]}

Similarly, if I include some wrong attributes or values in the patch request, the entire connection gets deleted.