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

Unable to assign interface to IP address via API #2299

Closed
explody opened this issue Aug 2, 2018 · 1 comment
Closed

Unable to assign interface to IP address via API #2299

explody opened this issue Aug 2, 2018 · 1 comment
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@explody
Copy link
Contributor

explody commented Aug 2, 2018

Environment

  • Python version: 3.6.5, 3.5.x
  • NetBox version: 2.4-beta1

Steps to Reproduce

Using the API, attempt to PUT or PATCH an existing IP address including an interface id.

postman CURL output. Both IP and iface ID #'s exist and are correct
curl -X PATCH \
  https://ourhost/api/ipam/ip-addresses/11111/ \
  -H 'authorization: Token XXXX' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: XXXX' \
  -d '{
    "interface": 2222
}'

Expected Behavior

The IP would now be assigned to the given interface.

Observed Behavior

From postman, the following error:

{
    "interface": {
        "non_field_errors": [
            "Invalid data. Expected a dictionary, but got int."
        ]
    }
}

We additionally tried to pass interface data as a nested hash, but encountered a variety of other errors. It appears that the shown approach should work, so this may hint at the base problem.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation beta labels Aug 2, 2018
@jeremystretch
Copy link
Member

Fixed in #2300. Thanks @explody!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
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