-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v2.11.8
Python version
3.7
Steps to Reproduce
- Create a new VM and note its ID (ex: 123)
- Create interface eth0 on the VM and note its ID (ex: 456)
- Make a REST API call to create a second interface on the VM, assigning the first interface as its parent:
curl -X POST \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
http://netbox/api/virtualization/interfaces/ \
--data '{"virtual_machine": 123, "name": "new", "parent": 456}'
This was originally reported under #6709.
Expected Behavior
The second interface should be created successfully, with the first interface assigned as its parent.
Observed Behavior
One of two things might happen, depending on how many device interfaces have been created:
- A ValueError exception is raised.
- The following error is returned:
{
"parent": [
"Related object not found using the provided numeric ID: 456"
]
}
This is due a bug in the definition of NestedVirtualMachineSerializer, which incorrectly references the dcim.Interface model.
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application