Device bulk import does not set parent device and device bay. #10519

Closed
opened 2025-12-29 21:32:33 +01:00 by adam · 2 comments
Owner

Originally created by @ymjpajak on GitHub (Nov 27, 2024).

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.2

Python Version

3.10

Steps to Reproduce

  1. Create rack, device types, devices...
  2. Try to post a child device using curl (customize it, and check appropiate ids of objects)
    curl -k -X POST -H "Authorization: Token " -H "Accept: application/json; indent=4" -H "Content-Type: application/json" https:///api/dcim/devices/ --data '{"name": "test_child_device" ,"role": "1", "manufacturer": "HPC", "device_type": "20", "status": "active", "site": "2", "rack": "15", "location": "2", "parent": "371", "device_bay": "443"}'
  3. Check in the device bay if the device is inserted

Expected Behavior

A device is inserted in the device bay.

Observed Behavior

The device is created by I have to insert it to the device bay by myself.

Originally created by @ymjpajak on GitHub (Nov 27, 2024). ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.1.2 ### Python Version 3.10 ### Steps to Reproduce 1. Create rack, device types, devices... 2. Try to post a child device using curl (customize it, and check appropiate ids of objects) curl -k -X POST -H "Authorization: Token <token>" -H "Accept: application/json; indent=4" -H "Content-Type: application/json" https://<ip>/api/dcim/devices/ --data '{"name": "test_child_device" ,"role": "1", "manufacturer": "HPC", "device_type": "20", "status": "active", "site": "2", "rack": "15", "location": "2", "parent": "371", "device_bay": "443"}' 4. Check in the device bay if the device is inserted ### Expected Behavior A device is inserted in the device bay. ### Observed Behavior The device is created by I have to insert it to the device bay by myself.
adam closed this issue 2025-12-29 21:32:33 +01:00
Author
Owner

@ymjpajak commented on GitHub (Nov 27, 2024):

And also custom fileds are not set while using curl post.

@ymjpajak commented on GitHub (Nov 27, 2024): And also custom fileds are not set while using curl post.
Author
Owner

@DanSheps commented on GitHub (Nov 28, 2024):

Hello @ymjpajak,

Thank you for opening this issue.

First of all, this is not a "Device Bulk Import", this an API call. Second, I just rerviewed the API spec and parent or device_bay are not valid fields on the POST API for /dcim/devices/.

This is likely intended as the proper way to install a device in the device bay would be after it has been created (similar to how in the GUI you need to first create the device, then go to the parent device to insert it) and then use the device_bay PATCH operation to install the device.

Please correct your bug report or open a feature request.

@DanSheps commented on GitHub (Nov 28, 2024): Hello @ymjpajak, Thank you for opening this issue. First of all, this is not a "Device Bulk Import", this an API call. Second, I just rerviewed the API spec and `parent` or `device_bay` are not valid fields on the `POST` API for `/dcim/devices/`. This is likely intended as the proper way to install a device in the device bay would be after it has been created (similar to how in the GUI you need to first create the device, then go to the parent device to insert it) and then use the device_bay `PATCH` operation to install the device. Please correct your bug report or open a feature request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10519