Let's use Infoblox API Part 2

Introduction

Let's use the API Part 2. In Part 1, we introduced a method using cURL, but this time we will use Python.

What are web APIs?

Python is simple and easy to learn, and is a popular language that ranks high in various programming language rankings. This time, I would like to build a simple script using such a popular language.

Script example in Python

In part 1, I will try to build a script in Python that acquires network information using cURL.

Running the above will return a result like this:

[
    {
        "_ref": "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4xLjAvMjQvMA:192.168.1.0/24/default",
        "network": "192.168.1.0/24",
        "network_view": "default"
    },
    {
        "_ref": "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yLjAvMjQvMA:192.168.2.0/24/default",
        "network": "192.168.2.0/24",
        "network_view": "default"
    }
]

The same result was returned when executing using cURL in Part 1. Now try registering a new network.

The shaded part is different from the code for getting network information. The network information to be added is described in JSON format, the code part that sends the request was changed from GET to POST, and the network information data is added.

Summary

Although it was introduced only with a simple example, I think that you have grasped the image of writing in Python. Basically, what can be done with the GUI can also be done with the API, so if you apply it, you can automate the work that you normally do manually with the API. For example, if the DHCP MAC filter is updated when the client PC is replaced, information is acquired from the client management system and automatically registered with the API, or the client performing unauthorized communication is detected by FW, etc. , if you know the IP, you can use Infoblox to check the MAC address, switch connection port, and login user by linking with AD. I think that it is possible to go to Infoblox has an excellent GUI, so you can make a lot of efficiency with just that alone, but I would like you to try it for the first time from one more step of small efficiency in everyday life!

Inquiry/Document request

Macnica Infoblox

Mon-Fri 8:45-17:30