def hostinterface_create(hostid, ip, dns='', main=1, type=1, useip=1, port=None, **connection_args):
 conn_args = _login(**connection_args)
 if (not port):
  port = INTERFACE_DEFAULT_PORTS[type]
 try:
  if conn_args:
   method = 'hostinterface.create'
   params = {'hostid': hostid, 'ip': ip, 'dns': dns, 'main': main, 'port': port, 'type': type, 'useip': useip}
   params = _params_extend(params, **connection_args)
   ret = _query(method, params, conn_args['url'], conn_args['auth'])
   return ret['result']['interfaceids']
  else:
   raise KeyError
 except KeyError:
  return ret

def hostinterface_create ( hostid , ip , dns = '' , main = 1 , type = 1 , useip = 1 , port = None , ** connection_args ) : conn_args = _login ( ** connection_args ) if ( not port ) : port = INTERFACE_DEFAULT_PORTS [ type ] try : if conn_args : method = 'hostinterface.create' params = { 'hostid' : hostid , 'ip' : ip , 'dns' : dns , 'main' : main , 'port' : port , 'type' : type , 'useip' : useip } params = _params_extend ( params , ** connection_args ) ret = _query ( method , params , conn_args [ 'url' ] , conn_args [ 'auth' ] ) return ret [ 'result' ] [ 'interfaceids' ] else : raise KeyError except KeyError : return ret
create new host interface note: this function accepts all standard host group interface: keyword argument names differ depending on your zabbix version .