pynetbox icon indicating copy to clipboard operation
pynetbox copied to clipboard

add cable trace (pathing) for front-ports and rear-ports

Open marcelb98 opened this issue 3 years ago • 2 comments

The Netbox API has no /trace endpoint for front-ports and rear-ports, but a /paths endpoint (see issue #434). This PR implements the /paths endpoint for pynetbox.

marcelb98 avatar Jan 23 '22 13:01 marcelb98

Hi, I've tested your code. It doesn't work for me when tracing an open path. I think a condition is missing in case there is no origin/destination port.

origin_endpoint = "/".join(
                    urlsplit(origin["url"])
                        .path[len(urlsplit(self.api.base_url).path):]
                        .split("/")[1:3]
                ) if origin else None
destination_endpoint = "/".join(
               urlsplit(destination["url"])
                   .path[len(urlsplit(self.api.base_url).path):]
                   .split("/")[1:3]
           ) if destination else None

srfwx avatar Jul 30 '22 15:07 srfwx