Getting all tunnels for device/vm/interface #14756
Answered
by
candlerb
peterbaumert
asked this question in
Help Wanted!
-
Hi all, I am currently trying to get the tunnels which belong to a device/vm via the api. But I fell like i am having a knot in my brain and can't figure out how to do it ( what queries to do ). Anyone else tried this already and has some hints? KR |
Beta Was this translation helpful? Give feedback.
Answered by
candlerb
Jan 10, 2024
Replies: 1 comment 1 reply
-
I guess you would first get a list of interfaces from the device or VM, and then query for tunnel terminations using interface_id or vminterface_id (which you should be able to repeat for multiple values) https://github.com/netbox-community/netbox/blob/v3.7.0/netbox/vpn/filtersets.py#L77-L119 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
peterbaumert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess you would first get a list of interfaces from the device or VM, and then query for tunnel terminations using interface_id or vminterface_id (which you should be able to repeat for multiple values)
https://github.com/netbox-community/netbox/blob/v3.7.0/netbox/vpn/filtersets.py#L77-L119