How can I refer to the name of the connected device on an interface? #12746
Replies: 2 comments 2 replies
-
interface.connected_endpoints.0.device.name |
Beta Was this translation helpful? Give feedback.
2 replies
-
That's it! -> Thank you very very much! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to reference the connected endpoint device in a jinja2 template on an interfaces.
Template:
hostname {{ device.name }}
!
{% for interface in device.interfaces.all() %}
interface {{ interface }}
Connected-endpoint {{ interface.connected_endpoints.0}}
{% endfor %}
Rendered Config:
hostname MGMT-SW1
!
interface GigabitEthernet0/0 (GigabitEthernet0/0)
Connected-endpoint eth0 (ethernet0)
I only got the interface back but not the device name
What is the correct reference to get the device name of the connected device. In this example it should be "R2"
REST-API - JSON of the interface
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions