v2.5 POST to API /dcim/interface-connections fails #2203

Closed
opened 2025-12-29 17:23:34 +01:00 by adam · 2 comments
Owner

Originally created by @awlx on GitHub (Dec 12, 2018).

Environment

  • Python version: 3.6-alpine3.8
  • NetBox version: 2.5.0

When calling api/dcim/interface-connections with corresponding interface IDs there appears an error about the interface not belonging to a device or virtualmachine:

The request failed with code 400 Bad Request: {'non_field_errors': ['An interface must belong to either a device or a virtual machine.']}

Steps to Reproduce

curl -X POST -H "Authorization: Token <token>" -H "Content-Type: application/json" -d '{"interface_a": <iface_a>, "interface_b": <iface_b>, "connection_status": true}' https://netbox.dev.test.net/api/dcim/interface-connections/

Expected Behavior

The connection should be created as in Netbox 2.4.9

Observed Behavior

The request failed with code 400 Bad Request: {'non_field_errors': ['An interface must belong to either a device or a virtual machine.']}

Originally created by @awlx on GitHub (Dec 12, 2018). ### Environment * Python version: 3.6-alpine3.8 * NetBox version: 2.5.0 When calling api/dcim/interface-connections with corresponding interface IDs there appears an error about the interface not belonging to a device or virtualmachine: > The request failed with code 400 Bad Request: {'non_field_errors': ['An interface must belong to either a device or a virtual machine.']} ### Steps to Reproduce `curl -X POST -H "Authorization: Token <token>" -H "Content-Type: application/json" -d '{"interface_a": <iface_a>, "interface_b": <iface_b>, "connection_status": true}' https://netbox.dev.test.net/api/dcim/interface-connections/` ### Expected Behavior The connection should be created as in Netbox 2.4.9 ### Observed Behavior > The request failed with code 400 Bad Request: {'non_field_errors': ['An interface must belong to either a device or a virtual machine.']}
adam added the type: bugstatus: accepted labels 2025-12-29 17:23:34 +01:00
adam closed this issue 2025-12-29 17:23:34 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 12, 2018):

The /dcim/interface-connections endpoint is now read-only. All connections are now created via the /dcim/cables/ endpoint. Marking this as a bug because the endpoint shouldn't accept a POST request at all.

@jeremystretch commented on GitHub (Dec 12, 2018): The `/dcim/interface-connections` endpoint is now read-only. All connections are now created via the `/dcim/cables/` endpoint. Marking this as a bug because the endpoint shouldn't accept a POST request at all.
Author
Owner

@awlx commented on GitHub (Dec 12, 2018):

Thx, I didn't find any hint about this change in the release notes. Might be worth adding that so people can adjust their scripts :).

  • Introduced a new API endpoint for cables at /dcim/cables/

Because this hint didn't say it obsoletes /dcim/interface-connections for writing.

@awlx commented on GitHub (Dec 12, 2018): Thx, I didn't find any hint about this change in the release notes. Might be worth adding that so people can adjust their scripts :). - Introduced a new API endpoint for cables at /dcim/cables/ Because this hint didn't say it obsoletes /dcim/interface-connections for writing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2203