- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
infoblox-client exceptions or errors?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2021 03:52 PM
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.