diff --git a/README.md b/README.md index d922280..c90c816 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ async def main(): await memphis.connect( host="", username="", + 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="", # you will get it on application type user creation password="", # depends on how Memphis deployed - default is connection token-based authentication port="", # defaults to 6666 diff --git a/memphis/memphis.py b/memphis/memphis.py index 7cf1db8..9b0460c 100644 --- a/memphis/memphis.py +++ b/memphis/memphis.py @@ -94,6 +94,7 @@ async def connect( self, host: str, username: str, + account_id: int = 1, connection_token: str = "", password: str = "", port: int = 6666, @@ -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. @@ -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 @@ -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)