pynautobot
pynautobot copied to clipboard
Support include kwarg in the Endpoint.all() Method
Today if you want to pull back all devices and include config_context data you must use the .filter call.
In the .all() call if you include the include kwarg it will fail
>>> nautobot.dcim.devices.all(include=['config_context'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Endpoint.all() got an unexpected keyword argument 'include'
>>>
Workaround is to use .filter(include=["config_context"]) with no other filtering criteria.
>>> nautobot.dcim.devices.filter(include=['config_context'])
[<pynautobot.models.dcim.Devices ('demo-cisco-xe') at 0x7f5c64d07b90>, <pynautobot.models.dcim.Devices ('jeff-8000v') at 0x7f5c64d1f410>, <pynautobot.models.dcim.Devices ('nxos9k') at 0x7f5c64d25210>, <pynautobot.models.dcim.Devices ('veos') at 0x7f5c64d26dd0>]