diff --git a/almdrlib/client.py b/almdrlib/client.py index 40acd3a..410ad31 100644 --- a/almdrlib/client.py +++ b/almdrlib/client.py @@ -43,11 +43,14 @@ def __init__(self, service_name, spec, if spec.get(OpenAPIKeyWord.X_ALERTLOGIC_SESSION_ENDPOINT) and \ self._session: - self._url = self._session.get_url(self._service_name) + self.update_url() logger.debug(f"Server initialized using '{self._url}' URL " + f"for '{self._service_name}' service.") + def update_url(self, account_id=None): + self._url = self._session.get_url(self._service_name, account_id) + @property def url(self): if self.variables: @@ -577,6 +580,10 @@ def f(**kwargs): params = {} headers = {} cookies = {} + account_id = kwargs.get('account_id') + + if account_id: + self._server.update_url(account_id) logger.debug( f"{self.operation_id} called " +