Can't create interface Tagged VLANs via API #8522

Closed
opened 2025-12-29 20:37:46 +01:00 by adam · 0 comments
Owner

Originally created by @Oussema-99 on GitHub (Aug 28, 2023).

NetBox version

v3.3.4

Python version

3.8

Steps to Reproduce

I have a device already created with all of its physical interfaces. I'm trying to update (Patch method) one of those interfaces to add the Tagged VLANs that it's supposed to have.
This is the Payload for my patch request:
{'name': 'Eth1/1', 'device': {'name': 'DEVICE01'}, 'mtu': 9216, 'description': 'BogusDescription', 'mode': 'tagged', 'tagged_vlans': [{'id': 185, 'vid': 100, 'name': 'BogusName'}, {'id': 186, 'vid': 200, 'name': 'BogusName2'}]}

Expected Behavior

Tagged VLANs (and the other items) are added to the interface

Observed Behavior

Request fails with the following Exception:
https://192.168.x.x/api/dcim/interfaces/5465/ Returned the following Response: 400 - {
"tagged_vlans": [
"Incorrect type. Expected pk value, received dict."
]

Originally created by @Oussema-99 on GitHub (Aug 28, 2023). ### NetBox version v3.3.4 ### Python version 3.8 ### Steps to Reproduce I have a device already created with all of its physical interfaces. I'm trying to update (Patch method) one of those interfaces to add the Tagged VLANs that it's supposed to have. This is the Payload for my patch request: `{'name': 'Eth1/1', 'device': {'name': 'DEVICE01'}, 'mtu': 9216, 'description': 'BogusDescription', 'mode': 'tagged', 'tagged_vlans': [{'id': 185, 'vid': 100, 'name': 'BogusName'}, {'id': 186, 'vid': 200, 'name': 'BogusName2'}]}` ### Expected Behavior Tagged VLANs (and the other items) are added to the interface ### Observed Behavior Request fails with the following Exception: https://192.168.x.x/api/dcim/interfaces/5465/ Returned the following Response: 400 - { "tagged_vlans": [ "Incorrect type. Expected pk value, received dict." ]
adam closed this issue 2025-12-29 20:37:46 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8522