batfish/pybatfish

Loading Questions from remote server

Closed this issue · 3 comments

Unable to find a way to load questions from a remote server (aka the docker service). Can this be added, or if it is already in the code add further documentation? Thanks,

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 376, in send
    timeout=timeout
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 610, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 283, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=9997): Max retries exceeded with url: /batfishworkmgr/getquestiontemplates (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fc06ae80d30>: Failed to establish a new connection: [Errno 111] Connection refused',))

Hey @packetpimp1,

This should be the default behavior, as long as the service is properly exposed. The error above looks like your client could not connect to the docker service.

See the load_questions documentation: https://pybatfish.readthedocs.io/en/latest/api.html

@packetpimp1 - Are the pybatfish client and the docker service running on the same host? If so, as Dan suggests, the default behavior should have worked. If not, then, you can point pybatfish to the remote server via bf_session.host = <hostname> (the default value of which is localhost).

@ratulm bf_session.host = <hostname> worked perfectly. Thank you.