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

/path not /trace on front and rear ports #434

Open
marcelb98 opened this issue Jan 4, 2022 · 2 comments
Open

/path not /trace on front and rear ports #434

marcelb98 opened this issue Jan 4, 2022 · 2 comments
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@marcelb98
Copy link

On front and rear ports the API provides /path and not /trace which is currently usable by the .trace() function on TracableRecords (which front and rear ports seem to be at the moment).

Calling the .trace() function on rear ports actually leads to an AttributeError (as there is no /trace provided by the Netbox API).

Maybe this changed from some older versions of Netbox…

@markkuleinio
Copy link
Contributor

NetBox 2.10 release notes (https://netbox.readthedocs.io/en/stable/release-notes/version-2.10/) say:

dcim.FrontPort:
Replaced the /trace/ endpoint with /paths/, which returns a list of cable paths

dcim.RearPort:
Replaced the /trace/ endpoint with /paths/, which returns a list of cable paths

It also says:

circuits.CircuitTermination:
Added the /trace/ endpoint

dcim.PowerFeed:
Added the /trace/ endpoint

In pynetbox, these all models inherit from TraceableRecord (that defines the trace() method):

  • Interfaces
  • PowerOutlets
  • PowerPorts
  • ConsolePorts
  • ConsoleServerPorts
  • FrontPorts
  • RearPorts

Maybe just copying TraceableRecord.trace() to TraceableRecord.paths() (with /paths request path in the code instead of /trace) (in pynetbox/models/dcim.py) could do? @marcelb98 are you able to test it with your data?

@marcelb98
Copy link
Author

Just copying the trace() to paths() and changing the requested URL doesn't work, as the /paths endpoint returns a different datastructure. While the /trace for interfaces returns a list of (Endpoint, Cable, Endpoint) tuples, the /paths returns a list of related paths, each with an origin and destination Endpoint and the path from origin to endpoint as a list of Interfaces, Front/RearPorts and Cables.

I've implemented a paths() function in PR #440.

@arthanson arthanson self-assigned this Oct 24, 2022
@abhi1693 abhi1693 added type: bug A confirmed report of unexpected behavior in the application status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

4 participants