Repository: netbox-community/netbox

Issue:
Add support for Molex Power Connectors
### NetBox version

v3.5.4

### Feature type

Data model extension

### Proposed functionality

Add **Molex Micro-Fit 2x2** to power port inlet type.

### Use case

Various devices utilize various Molex connectors for power input. For example, Cradlepoint E300 and IBR900-1200M routers and the Cisco 891 router all use a [2x2 Molex Micro-Fit connector](https://www.molex.com/en-us/products/part-detail/2147552042).

### Database changes

None required.

### External dependencies

None.
Add support for Molex Power Connectors
### NetBox version

v3.5.4

### Feature type

Data model extension

### Proposed functionality

Add **Molex Micro-Fit 2x2** to power port inlet type.

### Use case

Various devices utilize various Molex connectors for power input. For example, Cradlepoint E300 and IBR900-1200M routers and the Cisco 891 router all use a [2x2 Molex Micro-Fit connector](https://www.molex.com/en-us/products/part-detail/2147552042).

### Database changes

None required.

### External dependencies

None.


Discussion:
Are these devices connecting directly to a power source via these connectors? Typically Molex connectors are used to connect an external power supply, which itself houses the device's actual power port.
They are external PSU.  I have used 881's (similar to the 891's) before, it is a stupid connector.

However, if someone wanted to get pedantic they could model the power adapter as a separate device.
The Cradlepoints specifically can be [hardwired to a vehicle ](https://cradlepoint.com/product/accessories/gpio-power-cable-rail-safe-2x2-20awg/); the cable in this case just carries direct power and a couple GPIO lines.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Going to make this available for implementation as it does appear to be able to support direct connection to a DC power source.

Should likely add additional types for other devices (for example, Nexus 9k is typically a Molex Mini-FIT)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Can this feature be reviewed again for implementation, looks like there is already a solution under #13014 

The use case I have is although typically you are right these devices will use an included external power supply to convert from 240vAC -> 48vDC, there is also a use case i have in certain environments such as industrial controls cabinets where they will be connected directly to a 48v power source, using the Molex headers. Not a showstopper but it would be good to model the connector accurately if only for my own sanity, rather than just using the "other" connector type 😄 
Unfortunately no one has volunteered for this.  The linked PR was closed as this issue needed to be re-evaluated.

We would need a new PR going forward
I'd be happy to work on a new PR to implement this, if implementing the new connector types is the way forward
@arcticash All yours!
Are these devices connecting directly to a power source via these connectors? Typically Molex connectors are used to connect an external power supply, which itself houses the device's actual power port.
They are external PSU.  I have used 881's (similar to the 891's) before, it is a stupid connector.

However, if someone wanted to get pedantic they could model the power adapter as a separate device.
The Cradlepoints specifically can be [hardwired to a vehicle ](https://cradlepoint.com/product/accessories/gpio-power-cable-rail-safe-2x2-20awg/); the cable in this case just carries direct power and a couple GPIO lines.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Going to make this available for implementation as it does appear to be able to support direct connection to a DC power source.

Should likely add additional types for other devices (for example, Nexus 9k is typically a Molex Mini-FIT)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Can this feature be reviewed again for implementation, looks like there is already a solution under #13014 

The use case I have is although typically you are right these devices will use an included external power supply to convert from 240vAC -> 48vDC, there is also a use case i have in certain environments such as industrial controls cabinets where they will be connected directly to a 48v power source, using the Molex headers. Not a showstopper but it would be good to model the connector accurately if only for my own sanity, rather than just using the "other" connector type 😄 
Unfortunately no one has volunteered for this.  The linked PR was closed as this issue needed to be re-evaluated.

We would need a new PR going forward
I'd be happy to work on a new PR to implement this, if implementing the new connector types is the way forward
@arcticash All yours!

Resolving patch:
diff --git a/netbox/dcim/choices.py b/netbox/dcim/choices.py
--- a/netbox/dcim/choices.py
+++ b/netbox/dcim/choices.py
@@ -399,6 +399,10 @@ class PowerPortTypeChoices(ChoiceSet):
     TYPE_USB_MICRO_AB = 'usb-micro-ab'
     TYPE_USB_3_B = 'usb-3-b'
     TYPE_USB_3_MICROB = 'usb-3-micro-b'
+    # Molex
+    TYPE_MOLEX_MICRO_FIT_1X2 = 'molex-micro-fit-1x2'
+    TYPE_MOLEX_MICRO_FIT_2X2 = 'molex-micro-fit-2x2'
+    TYPE_MOLEX_MICRO_FIT_2X4 = 'molex-micro-fit-2x4'
     # Direct current (DC)
     TYPE_DC = 'dc-terminal'
     # Proprietary
@@ -520,6 +524,11 @@ class PowerPortTypeChoices(ChoiceSet):
             (TYPE_USB_3_B, 'USB 3.0 Type B'),
             (TYPE_USB_3_MICROB, 'USB 3.0 Micro B'),
         )),
+        ('Molex', (
+            (TYPE_MOLEX_MICRO_FIT_1X2, 'Molex Micro-Fit 1x2'),
+            (TYPE_MOLEX_MICRO_FIT_2X2, 'Molex Micro-Fit 2x2'),
+            (TYPE_MOLEX_MICRO_FIT_2X4, 'Molex Micro-Fit 2x4'),
+        )),
         ('DC', (
             (TYPE_DC, 'DC Terminal'),
         )),
@@ -635,6 +644,10 @@ class PowerOutletTypeChoices(ChoiceSet):
     TYPE_USB_A = 'usb-a'
     TYPE_USB_MICROB = 'usb-micro-b'
     TYPE_USB_C = 'usb-c'
+    # Molex
+    TYPE_MOLEX_MICRO_FIT_1X2 = 'molex-micro-fit-1x2'
+    TYPE_MOLEX_MICRO_FIT_2X2 = 'molex-micro-fit-2x2'
+    TYPE_MOLEX_MICRO_FIT_2X4 = 'molex-micro-fit-2x4'
     # Direct current (DC)
     TYPE_DC = 'dc-terminal'
     # Proprietary
@@ -749,6 +762,11 @@ class PowerOutletTypeChoices(ChoiceSet):
             (TYPE_USB_MICROB, 'USB Micro B'),
             (TYPE_USB_C, 'USB Type C'),
         )),
+        ('Molex', (
+            (TYPE_MOLEX_MICRO_FIT_1X2, 'Molex Micro-Fit 1x2'),
+            (TYPE_MOLEX_MICRO_FIT_2X2, 'Molex Micro-Fit 2x2'),
+            (TYPE_MOLEX_MICRO_FIT_2X4, 'Molex Micro-Fit 2x4'),
+        )),
         ('DC', (
             (TYPE_DC, 'DC Terminal'),
         )),


Test patch: