nautobot / pynautobot

Nautobot Python SDK
https://pynautobot.readthedocs.io/en/latest/index.html
Apache License 2.0
36 stars 32 forks source link

Add Object Relationships Option to Returned JSON Attributes #110

Closed aetherrealm closed 1 month ago

aetherrealm commented 1 year ago

When performing an API request outside of pynautobot using ?include=relationships the relationships created under Extensibility for the object are returned. This information is not included whether get, all, or filter are used, and even if it's cast to a dictionary. There are instances where knowing the object on the other end of the relationship is valuable, such as:

If I'm querying VRFs under IPAM, what VLAN do I have a relationship with (I.E. my iBGP VLAN for MLAG or VPC)?

jvanderaa commented 1 year ago

Makes sense to get this on into pynautobot to align with the included item.

jmcgill298 commented 1 month ago

@aetherrealm this is a behavior of the API, to pass include=relationships in pynautobot, you should do something like app.model.filter(..., include="relationships")