- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Infoblox python API help
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-2016 01:01 PM - edited 03-01-2016 01:02 PM
Solved! Go to Solution.
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-2016 01:18 PM
Host records can't be created on Microsoft managed zones. Try creating individual A/PTR records instead.
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-2016 01:21 PM
How do i create a A or a PTR record using this python API. Here are the list of methods it has :
- create_network
- delete_network
- create_networkcontainer
- delete_networkcontainer
- get_next_available_network
- create_host_record
- create_txt_record
- delete_host_record
- delete_txt_record
- add_host_alias
- delete_host_alias
- create_cname_record
- delete_cname_record
- update_cname_record
- create_dhcp_range
- delete_dhcp_range
- get_next_available_ip
- get_host
- get_host_by_ip
- get_ip_by_host
- get_host_by_extattrs
- get_host_by_regexp
- get_txt_by_regexp
- get_host_extattrs
- get_network
- get_network_by_ip
- get_network_by_extattrs
- get_network_extattrs
- update_network_extattrs
- delete_network_extattrs
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-2016 01:27 PM
Looks like this library does not support creating a/ptr records.
You might want to use this library instead - https://github.com/infobloxopen/infoblox-client
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-2016 01:31 PM
Ok thanks, let me try this library.
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-01-2016 04:24 PM
Ok, So far here what i have figured :
opts = {'host': '192.168.1.1', 'username': 'admin', 'password'assword ''}
conn = connector.Connector(opts)
To Create a A and PTR record :
a_record = objects.ARecord.create(conn, name='test.domain.com', ip='10.0.0.1)
ptr_record = objects.PtrRecordV4.create(conn, ptrdname='test.domain.com', ip='10.0.0.1')
To delete a A and PTR record :
a_record.delete()
ptr_record.delete()
But if i want to delete an already existing A and PTR , then how would i go about doing so ??
Any help would be appreciated!!!
Thanks
Anirudh
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-02-2016 06:51 AM
My guess is you need to perform a lookup for the record you want to delete and then use the object reference to delete.
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-02-2016 09:48 AM
You need to find the record, then use the delete method.
E.g.
find_arecord=objects.ARecord.search(conn, ip='10.0.0.1')
delete_arecord=find_arecord.delete()
Note that a record and ptr record searches currently only support search by ip address.
There are a number of helper functions in https://github.com/infobloxopen/infoblox-client/blob/master/infoblox_client/object_manager.py
You can use these as code examples to build your own helper functions such as searching a/ptr records by name instead of by ip address.
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-02-2016 10:42 AM
Thanks for the pointers guys, really helpfull!!!
Re: Infoblox python API help
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-02-2016 04:14 PM - edited 03-02-2016 04:16 PM
Now with this API, i have the ability to bulk add the A and PTR records by putting them in a for loop.
But once in a while i still get NIOS timed out:
infoblox_client.exceptions.InfobloxTimeoutError: Connection to NIOS timed out
How can i get past this, Is there a way to increate the timeout ?
Any pointers would be appreciated.
Thanks
Anirudh
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-03-2016 06:56 AM
John
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-03-2016 03:44 PM
Thanks for the suggetion. I will give that a try.
Right now i am catching this error as exception and rerunning the script several times to make sure A and PTR records are made.
Another question is my wapi version is 2.3, should i bother changing that in the library becasue the default value is :
wapi_version': '1.4
Regardless it still work
Thanks
Anirudh
Re: Infoblox python API help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-03-2016 05:14 PM
WAPI versions maintain compatibility with newer NIOS releases. So unless you need to use any of the new objects in WAPI 2.3, there's no need to upgrade the WAPI version in your Python code.