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

Enhance SwaggerUI to support NAPALM methods #1982

Closed
bdlamprecht opened this issue Mar 21, 2018 · 0 comments · Fixed by #3860
Closed

Enhance SwaggerUI to support NAPALM methods #1982

bdlamprecht opened this issue Mar 21, 2018 · 0 comments · Fixed by #3860
Labels
status: accepted This issue has been accepted for implementation type: documentation A change or addition to the documentation

Comments

@bdlamprecht
Copy link
Contributor

Issue type

[X] Feature request

Environment

  • Python version: 3.6
  • NetBox version: 2.3.1

Description

I know how to use the NetBox API directly from the CLI to get info from devices using NAPALM (and the works great!). However, I can't do the same thing in the SwaggerUI and I'm hoping a small change could enable me to do that.

What I'm trying to accomplish is to programatically query the devices I have in NetBox (via NAPALM) to see if their model matches the device_type (or specifically part_number) that I have defined in NetBox.

From what I can tell, pynetbox doesn't have this functionalty so I'm trying to use netbox-pyswagger (from @jeremyschulman) to accomplish this. However, that "client" is solely based on the output gathered from /api/docs/?format=openapi.

To clarify, under the dcim section of Swagger, there is this option:

GET /api/dcim/devices/{id}/napalm/

And when you expand it, you can only pass the id field.

After entering an id there and clicking the "Try It Out!" button, I can confirm (with command logging on the device in question) that NAPALM does connect just fine, but doesn't run anything else (due to not be told otherwise) and then disconnects.

The, the response seen in Swagger is the following:

Response Body
{}

Response Code
200

I suppose what I'm looking for is the option to pass other methods (via Swagger) to get the same information as I can using the CLI. I hope that makes sense. If not, let me know and I can try to explain further.

@jeremystretch jeremystretch added help wanted status: accepted This issue has been accepted for implementation labels Apr 19, 2018
@jeremystretch jeremystretch added type: documentation A change or addition to the documentation and removed help wanted labels May 2, 2019
jeremystretch added a commit that referenced this issue Jan 9, 2020
Fixes #1982: Swagger NAPALM documentation
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: documentation A change or addition to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants