API host.create() interface should not require a blank IP if DNS provided.
for the host.create() call, at least one interface is required.
At the moment, all of our interfaces are DNS base - but the IP address must still be passed along. Example:
interface = [ { "type": 1, # 1 is 'agent', 2 is 'SNMP', 3 is 'IPMI', 4 is 'JMX' "main": 1, # 0 is 'not default', 1 is 'default' "useip": 0, # 0 is 'use DNS', 1 is 'use IP' "ip": "", # doc says can be blank but not _undefined_ if using DNS "dns": f"{host['name']}.{hg_config['dns_domain']}", "port": "10050", # default port for zabbix agent # BUG: this is wrong for other template types } ]
The documentation (IMHO) implies that this is true - at: https://www.zabbix.com/documentation/6.4/en/manual/api/reference/hostinterface/object We get
Can be empty if the connection is made via DNS.
But the API would make more sense if this field could be left blank.