The device field on device-components (except InventoryItem) should not be writeable via. the API #7471

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

Originally created by @kkthxbye-code on GitHub (Jan 8, 2023).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.4.2

Python version

3.10

Steps to Reproduce

  1. Create a device with database id 1 and an interface with database id 1
  2. Create a device with database id 2
  3. Send the following request to the API:
    URL: http://127.0.0.1:8000/api/dcim/interfaces/1/
    JSON data:
{
  "device": 2
}

Expected Behavior

The interface should not be able to be moved to another device. We do not allow this in the UI. There are potential issue regarding cables and caching of paths.

Observed Behavior

The interface is moved to the other device.

We should disallow this for all devicecomponents except InventoryItem, as this is the way it works in the UI now.

Originally created by @kkthxbye-code on GitHub (Jan 8, 2023). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.4.2 ### Python version 3.10 ### Steps to Reproduce 1. Create a device with database id 1 and an interface with database id 1 2. Create a device with database id 2 3. Send the following request to the API: URL: http://127.0.0.1:8000/api/dcim/interfaces/1/ JSON data: ``` { "device": 2 } ``` ### Expected Behavior The interface should not be able to be moved to another device. We do not allow this in the UI. There are potential issue regarding cables and caching of paths. ### Observed Behavior The interface is moved to the other device. We should disallow this for all devicecomponents except InventoryItem, as this is the way it works in the UI now.
adam added the type: bugstatus: accepted labels 2025-12-29 20:23:48 +01:00
adam closed this issue 2025-12-29 20:23:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7471