Virtual machine parent interface assignment issue via API #5043

Closed
opened 2025-12-29 19:23:28 +01:00 by adam · 1 comment
Owner

Originally created by @Toosaman on GitHub (Jul 6, 2021).

NetBox version

v2.11.8

Python version

3.7

Steps to Reproduce

  1. Trying to create (or update) vm.interface object with parent interface assignment via API:
/api/virtualization/interfaces/
{
    "virtual_machine": 2,
    "name": "test1",
    "parent": 172
}

Expected Behavior

Interface successfully created (or updated) and object returned.

Observed Behavior

Getting an error:

{
    "parent": [
        "Related object not found using the provided numeric ID: 172"
    ]
}
Originally created by @Toosaman on GitHub (Jul 6, 2021). ### NetBox version v2.11.8 ### Python version 3.7 ### Steps to Reproduce 1. Trying to create (or update) vm.interface object with parent interface assignment via API: ``` /api/virtualization/interfaces/ { "virtual_machine": 2, "name": "test1", "parent": 172 } ``` ### Expected Behavior Interface successfully created (or updated) and object returned. ### Observed Behavior Getting an error: ``` { "parent": [ "Related object not found using the provided numeric ID: 172" ] } ```
adam added the type: bug label 2025-12-29 19:23:28 +01:00
adam closed this issue 2025-12-29 19:23:28 +01:00
Author
Owner

@ghost commented on GitHub (Jul 7, 2021):

Getting a similar issue when using the nested option for the parent 'parent': {'name': parent, 'virtual_machine': nb_dev.id},

getting the following error:

{'parent': ["Cannot resolve keyword 'virtual_machine' into field. Choices are: _cable_peer, _cable_peer_id, _cable_peer_type, _cable_peer_type_id, _cabled_as_a, _cabled_as_b, _name, _path, _path_id, cable, cable_id, child_interfaces, created, custom_field_data, description, device, device_id, enabled, id, ip_addresses, journal_entries, label, lag, lag_id, last_updated, mac_address, mark_connected, member_interfaces, mgmt_only, mode, mtu, name, parent, parent_id, tagged_items, tagged_vlans, tags, type, untagged_vlan, untagged_vlan_id"]}
@ghost commented on GitHub (Jul 7, 2021): Getting a similar issue when using the nested option for the parent `'parent': {'name': parent, 'virtual_machine': nb_dev.id},` getting the following error: ```python {'parent': ["Cannot resolve keyword 'virtual_machine' into field. Choices are: _cable_peer, _cable_peer_id, _cable_peer_type, _cable_peer_type_id, _cabled_as_a, _cabled_as_b, _name, _path, _path_id, cable, cable_id, child_interfaces, created, custom_field_data, description, device, device_id, enabled, id, ip_addresses, journal_entries, label, lag, lag_id, last_updated, mac_address, mark_connected, member_interfaces, mgmt_only, mode, mtu, name, parent, parent_id, tagged_items, tagged_vlans, tags, type, untagged_vlan, untagged_vlan_id"]} ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5043