Netbox: v2.5 POST to API /dcim/interface-connections fails

Created on 12 Dec 2018  路  2Comments  路  Source: netbox-community/netbox

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.']}

accepted bug

Most helpful comment

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.

All 2 comments

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shugotek picture shugotek  路  3Comments

hellerve picture hellerve  路  3Comments

markve-sa picture markve-sa  路  4Comments

billyzoellers picture billyzoellers  路  3Comments

soer7022 picture soer7022  路  3Comments