api/dcim/interface-connections allows duplicate connections via opposing directionality #1073

Closed
opened 2025-12-29 16:28:32 +01:00 by adam · 1 comment
Owner

Originally created by @lampwins on GitHub (Jul 3, 2017).

Issue type: bug report

Python version: 2.7
NetBox version: 2.0.7

Given two interfaces, create two connections by reversing interface_a and interface_b. The api allows this, thus creating the same connection twice but in different directions. I would expect the second request to fail saying one or both of these interfaces is already connected.

curl -X POST  -d '{ \ 
   "interface_b": "1970", \ 
   "interface_a": "1945" \ 
 }' 'http://netbox-dev.nw.cougars.int/api/dcim/interface-connections/'
curl -X POST -d '{ \ 
   "interface_b": "1945", \ 
   "interface_a": "1970" \ 
 }' 'http://netbox-dev.nw.cougars.int/api/dcim/interface-connections/'

screen shot 2017-07-03 at 1 00 12 pm

Originally created by @lampwins on GitHub (Jul 3, 2017). <!-- Please note: GitHub issues are to be used only for feature requests and bug reports. For installation assistance or general discussion, please join us on the mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please indicate "bug report" or "feature request" below. Be sure to search the existing set of issues (both open and closed) to see if a similar issue has already been raised. --> ### Issue type: bug report <!-- If filing a bug, please indicate the version of Python and NetBox you are running. (This is not necessary for feature requests.) --> **Python version:** 2.7 **NetBox version:** 2.0.7 Given two interfaces, create two connections by reversing `interface_a` and `interface_b`. The api allows this, thus creating the same connection twice but in different directions. I would expect the second request to fail saying one or both of these interfaces is already connected. ``` curl -X POST -d '{ \ "interface_b": "1970", \ "interface_a": "1945" \ }' 'http://netbox-dev.nw.cougars.int/api/dcim/interface-connections/' ``` ``` curl -X POST -d '{ \ "interface_b": "1945", \ "interface_a": "1970" \ }' 'http://netbox-dev.nw.cougars.int/api/dcim/interface-connections/' ``` ![screen shot 2017-07-03 at 1 00 12 pm](https://user-images.githubusercontent.com/1297132/27802189-35b7dd24-5ff0-11e7-9ab3-3af46286f56d.png)
adam added the type: bug label 2025-12-29 16:28:32 +01:00
adam closed this issue 2025-12-29 16:28:33 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 6, 2017):

This stems from the same root issue as #1285 (lack of model validation via the API). I'm going to close this issue to concentrate any discussion on the matter there.

@jeremystretch commented on GitHub (Jul 6, 2017): This stems from the same root issue as #1285 (lack of model validation via the API). I'm going to close this issue to concentrate any discussion on the matter there.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1073