Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async def main():
await memphis.connect(
host="<memphis-host>",
username="<application-type username>",
account_id="<account_id>", # You can find it on the profile page in the Memphis UI. This field should be sent only on the cloud version of Memphis, otherwise it will be ignored
connection_token="<broker-token>", # you will get it on application type user creation
password="<string>", # depends on how Memphis deployed - default is connection token-based authentication
port="<port>", # defaults to 6666
Expand Down
5 changes: 4 additions & 1 deletion memphis/memphis.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ async def connect(
self,
host: str,
username: str,
account_id: int = 1,
connection_token: str = "",
password: str = "",
port: int = 6666,
Expand All @@ -109,6 +110,7 @@ async def connect(
Args:
host (str): memphis host.
username (str): user of type root/application.
account_id (int): You can find it on the profile page in the Memphis UI. This field should be sent only on the cloud version of Memphis, otherwise it will be ignored
connection_token (str): connection token.
password (str): depends on how Memphis deployed - default is connection token-based authentication.
port (int, optional): port. Defaults to 6666.
Expand All @@ -122,6 +124,7 @@ async def connect(
"""
self.host = self.__normalize_host(host)
self.username = username
self.account_id = account_id
self.connection_token = connection_token
self.password = password
self.port = port
Expand Down Expand Up @@ -159,7 +162,7 @@ async def connect(
if self.connection_token != "":
connection_opts["token"]=self.connection_token
else:
connection_opts["user"]=self.username
connection_opts["user"]=self.username + "$" + str(self.account_id)
connection_opts["password"]=self.password

self.broker_manager = await broker.connect(**connection_opts)
Expand Down