My code:
t = TableauServerRest(domain, user, pw, site_content_url= siteContentUrl)t.signin()t.datasources.update_datasource_connection_by_luid(datasource_luid = luid, new_server_address=newServerName)
Throws error:
TableauServerRest' object has no attribute '_DatasourceMethods__build_connection_update_xml
It is not able to find:
@staticmethoddef __build_connection_update_xml(new_server_address: Optional[str] = None,new_server_port: Optional[str] = None,new_connection_username: Optional[str] = None,new_connection_password: Optional[str] = None) -> ET.Element:tsr = ET.Element('tsRequest')c = ET.Element("connection")if new_server_address is not None:c.set('serverAddress', new_server_address)if new_server_port is not None:c.set('serverPort', new_server_port)if new_connection_username is not None:c.set('userName', new_connection_username)if new_connection_username is not None:c.set('password', new_connection_password)tsr.append(c)return tsr
My code:
t = TableauServerRest(domain, user, pw, site_content_url= siteContentUrl)
t.signin()
t.datasources.update_datasource_connection_by_luid(datasource_luid = luid, new_server_address=newServerName)
Throws error:
TableauServerRest' object has no attribute '_DatasourceMethods__build_connection_update_xml
It is not able to find:
@staticmethod
def __build_connection_update_xml(new_server_address: Optional[str] = None,
new_server_port: Optional[str] = None,
new_connection_username: Optional[str] = None,
new_connection_password: Optional[str] = None) -> ET.Element:
tsr = ET.Element('tsRequest')
c = ET.Element("connection")
if new_server_address is not None:
c.set('serverAddress', new_server_address)
if new_server_port is not None:
c.set('serverPort', new_server_port)
if new_connection_username is not None:
c.set('userName', new_connection_username)
if new_connection_username is not None:
c.set('password', new_connection_password)
tsr.append(c)
return tsr
Which is available here: https://github.com/bryanthowell-tableau/tableau_tools/blob/0297b3187e73b89c4c5f108fc091a39a83ddaa1d/tableau_rest_api/methods/rest_api_base.py. I pulled the two functions into my local file and everything worked with the same arguments.