All writing
Api

The Ultimate Guide to Infoblox DDI WAPI Examples

Infoblox DDI API is an extension of the Infoblox DDI solution that provides a RESTful API interface for interacting with the Infoblox DDI system. The Infoblox DDI API allows you to perform various tas

The Ultimate Guide to Infoblox DDI WAPI Examples

If you want to automate tasks in Infoblox DDI (DNS, DHCP, and IP Address Management), the Infoblox WAPI (Web API) provides an easy way. This guide will provide examples of using the Infoblox DDI API to perform everyday tasks, such as creating DNS zones, records, and DHCP scopes. If you want to automate and streamline your network infrastructure, keep following this site for a BRAND new series.

What Is the Infoblox DDI WAPI?

Infoblox DDI WAPI is an extension of the Infoblox DDI solution that provides a RESTful (Representational State Transfer) API interface for interacting with the Infoblox DDI system. The Infoblox DDI WAPI allows you to perform various tasks, such as configuring DNS zones and records, managing DHCP scopes and leases, and managing IP addresses.

How Do You Create a DNS Zone Using the Infoblox WAPI?

To create a DNS zone using the Infoblox DDI API, you can use the following curl command:

curl -k -u admin:infoblox -H 'Content-Type: application/json' -X POST \
'https://infoblox.example.com/wapi/v2.7/zone_auth' \
-d '{"fqdn": "example.com", "view": "default"}'

We’re creating a DNS zone for “example.com” with the default view in this example.

How Do You Create a DNS Record Using the Infoblox WAPI?

To create a DNS record using the Infoblox DDI API, you can use the following curl command:

curl -k -u admin:infoblox -H 'Content-Type: application/json' -X POST \
'https://infoblox.example.com/wapi/v2.7/record:host' \
-d '{"name": "www", "zone": "example.com", "view": "default", "ipv4addr": "192.168.1.1"}'

In this example, we’re creating a DNS record for “www.example.com” with the default view and an IP address of “192.168.1.1”.

How Do You Create a DHCP Scope Using the Infoblox WAPI?

To create a DHCP scope using the Infoblox DDI API, you can use the following curl command:

curl -k -u admin:infoblox -H 'Content-Type: application/json' -X POST \
'https://infoblox.example.com/wapi/v2.7/network' \
-d '{"network": "192.168.1.0/24", "network_view": "default", "comment": "Test DHCP Scope"}'

In this example, we’re creating a DHCP scope for the network “192.168.1.0/24” with the default network view and a comment of “Test DHCP Scope”

How Do You Update a DNS Record Using the Infoblox WAPI?

To update a DNS record using the Infoblox DDI API, you can use the following curl command:

curl -k -u admin:infoblox -H 'Content-Type: application/json' -X PUT \
'https://infoblox.example.com/wapi/v2.7/record:a/ZG5zLnJlY29yZC5hbmRyb2lkLmNvbSxlbXBsb3llZS5jb20:www.example.com/default' \
-d '{"ipv4addr": "192.168.1.2"}'

In this example, we’re updating the IP address of the “www” record for the “example.com” zone in the default view to “192.168.1.2”.

How Do You Delete a DHCP Lease Using the Infoblox WAPI?

To delete a DHCP lease using the Infoblox DDI API, you can use the following curl command:

curl -k -u admin:infoblox -H 'Content-Type: application/json' -X DELETE \
'https://infoblox.example.com/wapi/v2.7/lease/ZG5zLm1ldGhvZC5jb20kMTkyLjE2OC4xLjEjMDE6Mjg6MTQsMDAwMA' \

In this example, we’re deleting the DHCP lease for the IP address “192.168.1.14”.

Why Should You Use the Infoblox WAPI for Network Automation?

In conclusion, the Infoblox DDI WAPI provides a powerful way to manage network resources and automate tasks. By leveraging the API, network administrators can save time and improve efficiency by automating routine tasks, such as creating DNS records, adding DHCP reservations, and updating network configurations.

In this guide, we’ve covered some basic examples of how to use the Infoblox DDI API with curl commands. We’ve seen how to create and delete DNS records, add DHCP reservations, and more. But these examples are just the beginning.

There are countless ways to use the Infoblox DDI API to automate network management tasks, and the possibilities are limited only by your imagination. With the right tools and knowledge, you can use the API to streamline network operations, reduce errors, and save time.

So if you want to take your network management to the next level, consider exploring the Infoblox DDI WAPI further. With some experimentation and creativity, you may find new and exciting ways to improve your network operations and better serve your organization’s needs.


Frequently Asked Questions

How do you create a DNS zone in Infoblox using the WAPI? Send a POST to /wapi/v2.7/zone_auth with a JSON body specifying fqdn and view: curl -k -u admin:infoblox -H 'Content-Type: application/json' -X POST 'https://infoblox.example.com/wapi/v2.7/zone_auth' -d '{"fqdn": "example.com", "view": "default"}'. The response returns the _ref of the newly created zone.

How do you update a DNS record’s IP address using the Infoblox WAPI? First retrieve the record’s _ref via a GET request, then send a PUT to the _ref URL with the new IP in the body: curl -k -u admin:infoblox -X PUT 'https://infoblox.example.com/wapi/v2.7/record:a/<_ref>' -d '{"ipv4addr": "192.168.1.2"}'. The _ref uniquely identifies the exact record to update.

How do you delete a DHCP lease using the Infoblox WAPI? Send a DELETE request to the lease’s _ref URL: curl -k -u admin:infoblox -X DELETE 'https://infoblox.example.com/wapi/v2.7/lease/<_ref>'. To find the _ref, first query GET /wapi/v2.7/lease filtered by IP address to locate the specific lease object.