Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
awlx opened this issue Dec 12, 2018 · 2 comments
Closed

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

awlx opened this issue Dec 12, 2018 · 2 comments
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@awlx
Copy link

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

@jeremystretch
Copy link
Member

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 jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Dec 12, 2018
@awlx
Copy link
Author

awlx commented 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 up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants