Skip to content

Commit 8bd44fa

Browse files
committed
Added support for providing host_uri argument when creating a Nebula object
1 parent a662092 commit 8bd44fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

NebulaPythonSDK/sdk.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ class Nebula:
1212
# the nebula class init module serves as the login against the nebula API as it's the only shared thing among the
1313
# class functions
1414
def __init__(self, username=None, password=None, token=None, host="127.0.0.1", port=80, protocol="http",
15-
request_timeout=60):
15+
host_uri=None, request_timeout=60):
1616
self.request_timeout = request_timeout
1717
self.username = username
1818
self.password = password
1919
self.token = token
2020
self.protocol = protocol
2121
self.port = port
22-
self.host = protocol + "://" + host + ":" + str(port)
22+
if host_uri:
23+
self.host = host_uri
24+
else:
25+
self.host = protocol + "://" + host + ":" + str(port)
2326
self.headers = {
2427
'content-type': "application/json",
2528
'cache-control': "no-cache"

0 commit comments

Comments
 (0)