netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.77k stars 2.54k forks source link

Introduce "Connector Types" under "Device Components" to allow additional power connector types #10838

Closed ypid closed 1 year ago

ypid commented 1 year ago

NetBox version

v3.3.7

Feature type

Data model extension

Proposed functionality

Introduce a new data model ConnectorType that allows users to define additional connector types. The naming is kept generic so that the ConnectorType could be used in all models that define ports (like PowerPort), PowerOutlet and Interface but this proposal is only about the power domain.

This proposal supersedes/closes the following alternatives:

Terminology: The term "custom" should be avoided in the context of this proposal. "Custom" is used differently in NetBox. The term "additional" is preferred as it expresses the different mindset behind the ConnectorType model that extends predefined/hardcoded ConnectorType that NetBox ships with. This proposal introduces the term "connector" to keep it generic, as mentioned above.

A word about Interface: While I would have use cases for additional Interface types, I am not sure that this is common enough or even wanted in NetBox. If an interface type is common enough, it should be added to NetBox directly. So I don’t propose other connector types here but I am open to be convinced other.

Use case

Issues raised in the past have shown that users have connector types that are either too unusual or legacy to be added to NetBox directly. It allows to accurately model power connections with all the benefits NetBox users know and love like being able to search, validate data with Reports. It will also integrate nicely with the planned feature #8323.

Database changes

Yes.

External dependencies

No.

jeremystretch commented 1 year ago

Similar proposals have previously been raised and rejected. You can find them here on GitHub by searching closed issues. Please also see this FAQ explaining why NetBox does not permit users to invent custom connector types.

Issues raised in the past have shown that users have connector types that are either too unusual or legacy to be added to NetBox directly.

If there's a valid reason to add new types that will benefit a substantial portion of the user base, we'll happily do so. You're welcome to reopen #10546.

ypid commented 1 year ago

I get your point and why you reject this proposal. Without having checked, I would assume the plugin API cannot extend power port types. Feel free to correct me if I am wrong.

You're welcome to reopen #10546.

Done that.

  1. Representing each type as a database object would impose a substantial performance penalty.

I don’t think this counts (anymore). NetBox (by now) has all the caching infrastructure to deal with this if it were a real problem. Maybe you can remove this argument from the FAQ?

  1. Allowing custom types would make the device library much more difficult, if not impossible, to use.

Not impossible but it needs to be considered. Using the slug as I already proposed can work, then the type could be prefixed for export (e. g. https://github.com/netbox-community/devicetype-library/) so that it is clear that this is an additional connector type.