Define napalm port and transport for each platform #1672

Closed
opened 2025-12-29 16:34:17 +01:00 by adam · 5 comments
Owner

Originally created by @ChrisdAutume on GitHub (Apr 16, 2018).

Issue type

[X ] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.4
  • NetBox version: 2.3.2

Description

Working with a variety of network platform os, we usually don't use the default port and transport. For now, it can only be changed using global parameter NAPALM_ARGS witch apply to all devices. This can be very problematic for exemple when working with NX-OS api (http/https/ssh) and Junos (netconf).

I suggest to add an optional specification of these two parameter in the platform create/edit page, the parameter will be merged with NAPALM_ARGS before napalm use.

Originally created by @ChrisdAutume on GitHub (Apr 16, 2018). ### Issue type [X ] Feature request <!-- An enhancement of existing functionality --> [ ] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: 3.5.4 <!-- Example: 3.5.4 --> * NetBox version: 2.3.2 <!-- Example: 2.1.3 --> <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description Working with a variety of network platform os, we usually don't use the default port and transport. For now, it can only be changed using global parameter NAPALM_ARGS witch apply to all devices. This can be very problematic for exemple when working with NX-OS api (http/https/ssh) and Junos (netconf). I suggest to add an optional specification of these two parameter in the platform create/edit page, the parameter will be merged with NAPALM_ARGS before napalm use.
adam added the status: acceptedtype: feature labels 2025-12-29 16:34:17 +01:00
adam closed this issue 2025-12-29 16:34:18 +01:00
Author
Owner

@bdlamprecht commented on GitHub (Apr 16, 2018):

I agree that this option ideally would not be something that is globally defined, however, there are other optional_args that can be sent to NAPALM which (I believe) don't fit within your current change to the model for platform.

For example, all of the optional_args that NAPALM offers are shown here. A few off the top of my head that would be important (besides port and transport) are secret and config_lock.

Unfortunately, I don't know of a solution that would enable all of this added functionality while at the same time keeping things straightforward and uncomplicated to use when all you need are the defaults.

Just to be clear, I'm not dismissing the need, I'm merely adding a few thoughts on the issue at hand so as to "get it right" without going through several changes.

@bdlamprecht commented on GitHub (Apr 16, 2018): I agree that this option ideally would not be something that is globally defined, however, there are other `optional_args` that can be sent to NAPALM which (I believe) don't fit within your current change to the `model` for `platform`. For example, all of the `optional_args` that NAPALM offers are shown [here](http://napalm.readthedocs.io/en/latest/support/#optional-arguments). A few off the top of my head that would be important (besides `port` and `transport`) are `secret` and `config_lock`. Unfortunately, I don't know of a solution that would enable all of this added functionality while at the same time keeping things straightforward and uncomplicated to use when all you need are the defaults. Just to be clear, I'm not dismissing the need, I'm merely adding a few thoughts on the issue at hand so as to "get it right" without going through several changes.
Author
Owner

@ChrisdAutume commented on GitHub (Apr 17, 2018):

Well, I agree that it can be good to handle all parameter. I didn't find a good idea to do it yesterday.

Maybe the use of a napalm_optional_args in the platform model with serialisation/json and dynamic form can be a better proposition. With this setup, we can use planty of parameter or none if we only need the default, but it's less sexy.

@ChrisdAutume commented on GitHub (Apr 17, 2018): Well, I agree that it can be good to handle all parameter. I didn't find a good idea to do it yesterday. Maybe the use of a `napalm_optional_args` in the platform model with serialisation/json and dynamic form can be a better proposition. With this setup, we can use planty of parameter or none if we only need the default, but it's less sexy.
Author
Owner

@jeremystretch commented on GitHub (May 22, 2018):

Let's avoid hard-coding any fields for specific NAPALM arguments, as there are quite a few today and there will likely be more in the future. A more robust approach might be to introduce a single napalm_args JSON field to store arbitrary per-platform arguments.

@jeremystretch commented on GitHub (May 22, 2018): Let's avoid hard-coding any fields for specific NAPALM arguments, as there are [quite a few](https://napalm.readthedocs.io/en/latest/support/index.html#list-of-supported-optional-arguments) today and there will likely be more in the future. A more robust approach might be to introduce a single `napalm_args` JSON field to store arbitrary per-platform arguments.
Author
Owner

@amuckart commented on GitHub (Jun 14, 2018):

I second the need for a per-platform access configuration. In a perfect world it would be nice to be able to define 'templates' of custom arguments to NAPALM (as free text to avoid having to track changes in NAPALM) and then assign those to devices or device templates in Netbox.

@amuckart commented on GitHub (Jun 14, 2018): I second the need for a per-platform access configuration. In a perfect world it would be nice to be able to define 'templates' of custom arguments to NAPALM (as free text to avoid having to track changes in NAPALM) and then assign those to devices or device templates in Netbox.
Author
Owner

@jeremystretch commented on GitHub (Jun 29, 2018):

This has been implemented in 35d58d2

@jeremystretch commented on GitHub (Jun 29, 2018): This has been implemented in 35d58d2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1672