SpriteLink / NIPAP

Neat IP Address Planner - NIPAP is the best open source IPAM in the known universe, challenging classical IP address management (IPAM) systems in many areas.
https://spritelink.github.io/NIPAP/
MIT License
543 stars 132 forks source link

External access from remote host (pynipap) #1324

Closed johnroyal88 closed 1 year ago

johnroyal88 commented 1 year ago

I have a remote host from which I want to run my script and access the NIPAP API externally. Remote host is reachable from NIPAP server (10.10.10.36) and I already updated the nipap.conf file per below:

listen = 0.0.0.0
port = 1337

Below is the error I got from the remote host: vm:~$ python3 Python 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. --> import pynipap --> from pynipap import VRF, Pool, Prefix --> pynipap.xmlrpc_uri = "http://user01:user01@10.10.10.36:1337/XMLRPC" --> a = pynipap.AuthOptions({'authoritative_source': 'nipap'}) --> print(a) --> <pynipap.AuthOptions object at 0x7f35bd1063d0> --> search_result = Prefix.smart_search('192.168.2.0/24') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3/dist-packages/pynipap.py", line 1103, in smart_search result['error'] = smart_result['error'] KeyError: 'error'

Remote host: Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal

garberg commented 1 year ago

Strange, I don't see anything obviously wrong there. Does it work if you try to do the same thing locally on the server where nipapd is running? Any error messages from nipapd?

garberg commented 1 year ago

Closing.