infoblox-client update

Posts: 4
12845     0

Has anyone updated host records using python infoblox-client.  I can create and delete entries but I want to update.  I updated the object ipaddress under the HostRecordV4 but that did not update the rest of the ip4vaddrs section of the object.  The process I used was.


Get the host record.

Update object local.


Then tried to store the object back via the update method.  Is this right?


Any suggestion would be appreciated.



Re: infoblox-client update

Posts: 4
12846     0

I solved this I updated the ipv4addrs part of the object and it worked.  Updating the object HostRecordV4 does not affect the overall object change of IP.

Re: infoblox-client update

Posts: 52
12846     0

Sorry, but this isn't really helpful.


A snippet of code would be helpful.


For instance, I'm attempting to perform a lookup to see if a PTR record exists for an IP.  If one exists, I'l want to delete it, Trying to figure out the operands necesary for say objects.PtrRecord.fetch().

Re: infoblox-client update

Posts: 52
12846     0

so, using the infoblox-client, I can create an object in python:

from infoblox_client import connector
from infoblox_client import objects
opts = {'host' :ibgm, 'username' : u_name, 'password' : p_word}
conn = connector.Connector(opts)

ea = objects.EA({'Date Assigned': str(, 'Source': 'HD Portal',
                 'User Contact': ''})
my_ip = objects.IP.create(ip='')
host = objects.HostRecord.create(conn, name='', ip=my_ip, extattrs=ea)

This gets me an object called host, of class infoblox_client.objects.HostRecordV4, which consists of:

HostRecordV4: ipv4addrs="[IPv4: ipv4addr="", configure_for_dhcp="False", _ref="record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQuX2RlZmF1bHQub3JnLm1pdHJlLm5ld19ob3N0LjEwLjIwOC4wLjIwLg:", ip="", host=""]", extattrs="EAs:Date Assigned=2019-04-26,Source=HD Portal,User", _ref="record:host/", ipv4addr="" I have a new EA, and I wish to update the object with this info.

At some time later in the same run, I need to add an EA, one which was unknown to me until AFTER I created the object.


If the new EA is:

ticket = '12345'
ea = objects.EA({'work#': ticket})

How do I update the object using the infoblox-client?  I will need to do this on a variety of Resource Record types, but expect the host record will be the most common.   I can do this using a different interface/client, but I'm trying to figure out this new one.


I suppose I could delete and then recreate, but that seems stupid, and the delete operation seems similar to the update operation, in that they are both documented as using self as the operand in the docs, with zero actual examples.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You