infobloxopen / infoblox-client

Infoblox NIOS Python WAPI Client
Apache License 2.0
141 stars 105 forks source link

Create Host Record with already created IP #360

Closed mr-oz-09 closed 1 year ago

mr-oz-09 commented 1 year ago

I cant seem to create a host record with an already given IP address. I try passing it objects.HostRecord.create(conn, view='name',zone='zonename', name='isntancename', ipv4addr='ip'). I get an error stating "ip address is missing for Host Record" . I print out the ip before running the command so I know its there. If i try and pass it with ipv4addrs=[ip]. I get "IP must be string or NIOS IP object". I dont see any clear documentation on how to do this. Any help would be greatly appreciated.

sarya-infoblox commented 1 year ago

Hi @mr-oz-09, could you please share more details on what exactly you are trying to fetch? Also, it would be great if you can share your requirement and the code you are trying.

mr-oz-09 commented 1 year ago

Hello @sarya-infoblox , I am trying to create a HostRecord with passing in a single IP and name. I am using the latest release of the plugin as well. The code I am trying to use is as follows ops = {'host': infourl, 'username': uname, 'password': password,, 'wapi_version': '2.11.2', 'max_retries': 5} connection = connector.Connector(opts) objects.HostRecord.create(connection, zone=zonename, name=instancename, ip=my_ip, check_if_exists=True, update_if_exists=false)

mr-oz-09 commented 1 year ago

Closing this. It seems you need the IP.create method before sending in an IP address to the Host.Create