Defining infrastructure as code(IaC) is one of the easiest ways to manage the whole infrastructure and you’ll probably like it more if you are not a fan of using GUI to manage stuff. In this beginner’s guide to understanding terraform for cloud automation, let’s see what this buzzword really is all about Terraform is a…
Month: November 2021
Netmiko SSH Proxy via JumpHost
Off late I have been required to access the network devices through a JumpHost. One of the easiest methods to do this was using python’s netmiko module. My setup looks like this Windows Machine ——- SSH tunnel ——- Linux JumpHost ——-SSH to ——- Network Devices Here are the basic steps that I followed to get…
What is Pydantic?
While reading about FASTAPI, it became more imperative to understand a little more about Pydantic to be able to build a better and more robust self-made API. In this post, I will try to answer the questions I had on my journey to understand more about FASTAPI. What is Pydantic and What is it used…
Python API Using FASTAPI – UPDATE – PUT – PATCH – Part V
To continue our journey to build a python API using FASTAPI, we will see how to update a record in the database either fully or partially. These operations are called PUT or PATCH. The fundamental difference between a PUT and PATCH operation is that PUT indicates updating the entire record while PATCH means updating a…
Python API Using FASTAPI – POST – CREATE – Part IV
Up until now, we have seen various techniques of dealing with GET requests but this post will deal with the next operation of POST which means creating a new object or resource on the server/database. The table below gives the mapping of the HTTP request methods to CRUD operations. Let’s see how to use POST…
Python API Using FASTAPI – For Network Engineers – Path and Query Parameters – Part III
To make a properly documented Python API Using FastAPI, we can use fastapi’s Path and Query module to pass in more parameters that give more context to that the path and query variables that we use. For example from previous posts if we consider this little excerpt PATH PARAMETERS And now if we go to…
Python API Using FASTAPI – For Network Engineers – Dynamic Routes – Part II
In Part 1 we saw how to get started with FASTAPI and writing simple GET endpoints. In this post, we will see how we can configure dynamic routes to accept variables in the get request. Please note I am not referring to passing query parameters here. We will see how to use query parameters in…
Python API Using FASTAPI – For Network Engineers – Part I
There are multiple frameworks one could leverage to write a simple API but in this post, we are going to talk about a relatively newer framework called FASTAPI for writing your own quick and simple python API using FASTAPI for network automation. Step1:- Create a virtual environment and install the required libraries. Step2:- Download database.csv…