Disable replicate_components when trying to create a modules? #7232

Closed
opened 2025-12-29 20:20:42 +01:00 by adam · 2 comments
Owner

Originally created by @himanpishnamaz on GitHub (Nov 15, 2022).

NetBox version

v3.3.7

Python version

3.8

Steps to Reproduce

I am trying to add modules to a module_bay and disable Replicate components because I already have interfaces just need to add modules to module bay.
Using GUI I can disable Replicate components and it is working without any problem
But when I want to send same thing using api is not working and it shows error regarding duplicate interfaces

json_data = {
"device": {"name":"AAA"},
"module_bay": 57,
"module_type": 1,
"serial": "A",
"replicate_components": false
}

Expected Behavior

When I am trying to create a new modules I need to be able to enable or disable Replicate components

Observed Behavior

duplicate key value violates unique constraint "dcim_interface_device_id_name_bffc4ec4_uniq"
DETAIL:  Key (device_id, name)=(233, 1/1/1) already exists.
Originally created by @himanpishnamaz on GitHub (Nov 15, 2022). ### NetBox version v3.3.7 ### Python version 3.8 ### Steps to Reproduce I am trying to add modules to a module_bay and disable Replicate components because I already have interfaces just need to add modules to module bay. Using GUI I can disable Replicate components and it is working without any problem But when I want to send same thing using api is not working and it shows error regarding duplicate interfaces json_data = { "device": {"name":"AAA"}, "module_bay": 57, "module_type": 1, "serial": "A", "replicate_components": false } ### Expected Behavior When I am trying to create a new modules I need to be able to enable or disable Replicate components ### Observed Behavior <pre class="exception_value">duplicate key value violates unique constraint &quot;dcim_interface_device_id_name_bffc4ec4_uniq&quot; DETAIL: Key (device_id, name)=(233, 1/1/1) already exists. </pre>
adam closed this issue 2025-12-29 20:20:42 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 18, 2022):

When I am trying to create a new modules I need to be able to enable or disable Replicate components

This is not currently supported behavior. Please submit a feature request detailing your use case and the proposed implementation.

@jeremystretch commented on GitHub (Nov 18, 2022): > When I am trying to create a new modules I need to be able to enable or disable Replicate components This is not currently supported behavior. Please submit a [feature request](https://github.com/netbox-community/netbox/issues/new?assignees=&labels=type%3A+feature&template=feature_request.yaml) detailing your use case and the proposed implementation.
Author
Owner

@asmaps commented on GitHub (Dec 1, 2022):

I have fixed this in my fork by adding 2 query parameters "adopt_components" and "disable_replication" which do the same as the checkboxes in the form of the regular UI. Do you still need a feature request or could you reopen this issue and assign it to me so I can create a PR? @jeremystretch

@asmaps commented on GitHub (Dec 1, 2022): I have fixed this in my fork by adding 2 query parameters "adopt_components" and "disable_replication" which do the same as the checkboxes in the form of the regular UI. Do you still need a feature request or could you reopen this issue and assign it to me so I can create a PR? @jeremystretch
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7232