Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API & Integration, DevOps,NetOps,SecOps

Reply

infoblox-client exceptions or errors?

New Member
Posts: 1
742     0

I am very new to working with Python and APIs in general. I am trying to automate the creation of new host records in Infoblox by getting the next availble IP from a specified subnet. I came across the infoblox-client libarary and it looked promising.

 

I am able to create host records in my script using a combination of the following:

 

objects.IPAllocation.next_available_ip_from_cidr
objects.IP.create
objects.HostRecord.create

 

Unfortunately when there are no more availble IPs in the subnet that the user specifies, my script fails. I am trying to capture the exception or error that is returned by the Infoblox server, so I can show the text of why it failed in that case.

 

I am having hard time understanding how to use the exception classes. Does anyone have an example they can share with a novice?

 

Thanks all. The forum is a great resource. Hopefully I can contribute in the future.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You