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

Update terminations in cable by API #13581

Closed
Etibru opened this issue Aug 28, 2023 · 2 comments · Fixed by #13337
Closed

Update terminations in cable by API #13581

Etibru opened this issue Aug 28, 2023 · 2 comments · Fixed by #13337
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application

Comments

@Etibru
Copy link

Etibru commented Aug 28, 2023

NetBox version

V.3.5.8

Python version

3.10

Steps to Reproduce

  1. Create 2 devices with one or more network interfaces

  2. Create cable between devices
    example : DeviceA(mgmt0) to DeviceB (ge-1/0/2)

  3. Now use PUT/PATCH API (/api/dcim/cables/{id_of_your_cable}/) (example id_of_your_cable = 23 for exemple)

curl -X 'PUT' \
  'http://X.X.X.X:8100/api/dcim/cables/23/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFTOKEN: XXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -d '{
  "a_terminations": [{ "object_type": "dcim.interface", "object_id": 187 }],
  "b_terminations": [{ "object_type": "dcim.interface", "object_id": 66 }],
  "status": "connected",
  "type": "cat7"
}
'

In this application, the device A interface identifier remains the same (so 187 is for the device A interface called mgmt0), but the device B interface has changed, 66 is one device interface but another (for example ge-1/0/3).

You will get this error :

{
  "error": "list index out of range",
  "exception": "IndexError",
  "netbox_version": "3.5.8",
  "python_version": "3.10.12"
}

Expected Behavior

I want to modify the cable termination(s)
return the cable with the new interface(s)

Observed Behavior

error 500

{
  "error": "list index out of range",
  "exception": "IndexError",
  "netbox_version": "3.5.8",
  "python_version": "3.10.12"
}
@Etibru Etibru added the type: bug A confirmed report of unexpected behavior in the application label Aug 28, 2023
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows labels Aug 28, 2023
@arthanson arthanson self-assigned this Sep 6, 2023
@arthanson arthanson removed the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Sep 6, 2023
@arthanson
Copy link
Collaborator

#13337 looks like it fixes this as well.

@DanSheps DanSheps added the status: accepted This issue has been accepted for implementation label Sep 7, 2023
@jeremystretch
Copy link
Member

This appears to be a duplicate of #11901, which has been resolved by #13337.

@jeremystretch jeremystretch added status: duplicate This issue has already been raised and removed status: accepted This issue has been accepted for implementation topic: cabling severity: medium Results in substantial degraded or broken functionality for specfic workflows labels Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants