Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run Napalm Methods using the napalm Plugin #14

Open
resparis opened this issue Jun 9, 2023 · 1 comment
Open

How to run Napalm Methods using the napalm Plugin #14

resparis opened this issue Jun 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@resparis
Copy link

resparis commented Jun 9, 2023

Hi Team,

I was using the previous version of netbox and I was able to run Napalm Methods using the following API endpoint, sending the netbox device id and the method:

/dcim/device/{id}/napalm

Using napalm as method, seems the endpoint is:

/api/plugins/netbox_napalm_plugin/napalmplatformconfig/{id}/napalm/

I can't find a way to send the method I want to run.

image

Am I missing something?

Thanks!

@resparis resparis added the bug Something isn't working label Jun 9, 2023
@steffenkremser
Copy link

i'm also missing the napalm proxy endpoint /api/dcim/device/{id}/napalm/menthod=get_xxx

.. but i don't see

/api/plugins/netbox_napalm_plugin/napalmplatformconfig/{id}/napalm/...

as a replacement, because the "parent" endpoint

/api/plugins/netbox_napalm_plugin/napalmplatformconfig/{id}

exposes the model "Napalm Platform Config" (as defined by the napalm plugin)
.. meaning the /{id} part is the PK of a platformconfig object .. NOT a device id

yes. one could add more parameters (&target_device_id=...)
.. but that negates the whole purpose of this model
(predefined mapping from "device.platform" value to either "napalm driver" or None)

Also, passing both platformconfig.pk and device.pk to the API would be

  • redundant (device.platform implies the driver)
  • conflict-prone (platformconfig "IOS" vs. non-IOS-device)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants