↓Skip to main content
  1. Tags/

Python

2025


Creating Your Own Validation

·678 words·4 mins
I recently was presented with a request to look at where there was a request to validate that a Rack would be unique at a Location in Nautobot. I took a look at the data validation engine and wasn’t able to determine a method to make this work there. So here is the solution.

Cleaning Up Python Environment

·911 words·5 mins
Recently I updated my Python development environments to use Python UV for managing Python versions and tools on the system. In this post I take you on the journey that I went on to replace pyenv and Pipx.

2023


Nautobot: Get IP Addresses From Nautobot

·1988 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. This device has 62 interfaces, so being able to filter down to which interface IP address we are looking for makes sense.

2022


GraphQL - Aliasing

·1052 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. In Nautobot a place is typically defined as the key site. In the Meraki world this is commonly set up as a network. Without GraphQL’s alias feature, the developer would need to translate this data over.