Skip to main content
  1. Tags/

python

2023


Nautobot: Get IP Addresses From Nautobot

·1979 words·10 mins
One of Nautobot’s primary functions is to serve as an IPAM solution. Within that realm, the application needs to provide a method to get at IP address data for a device, quickly and easily. In this post I will review three prominent methods to get an IP address from Nautobot. It will demonstrate getting the address via: Nautobot REST API curl Python Requests GoLang HTTP pynautobot Ansible Lookup Nautobot GraphQL API curl Python Requests GoLang HTTP pynautobot Ansible Lookup Each method I will demonstrate how to get the IP address for Loopback0 on the device bre01-edge-01 within the demo instance of Nautobot.

2022


GraphQL - Aliasing

·1045 words·5 mins
One of the features that I find myself using periodically that I think is underrated as far as using GraphQL is its ability to alias return keys in the response. This can be extremely helpful for developers writing applications, as it allows them to have the API response with the keys they are looking for. I have found this feature particularly useful when working on applications like Meraki and Nautobot together.

Python Pseudo Code

·519 words·3 mins
One of my favorite things to do as I get started with writing a piece of automation or code, is to lay out the design with pseudo code in the form of comments. I will do this with both Python and Ansible automations, and is a great way to get started on writing your automation or code. What pseudo code does for you is to layout the process at which you wish to accomplish a particular goal.