Tableau Server Client (TSC)
中datasources.populate_connections
的用法。
用法
datasources.populate_connections(datasource_item)
填充指定數據源的連接。
此方法檢索指定數據源的連接信息。 REST API 旨在僅返回您明確要求的信息。查詢所有數據源時,不包括連接信息。使用此方法檢索連接。該方法將數據連接列表添加到數據源項 (datasource_item.connections
)。這是ConnectionItem
對象的列表。
REST API:Query Datasource Connections
參數
名字 | 說明 |
---|---|
datasource_item |
datasource_item 指定要使用連接信息填充的數據源。 |
異常
錯誤 | 說明 |
---|---|
Datasource item missing ID. Datasource must be retrieved from server first. |
如果未指定 datasource_item,則會引發錯誤。 |
返回
沒有任何。 ConnectionItem
對象列表添加到數據源 (datasource_item.connections
)。
示例
# import tableauserverclient as TSC
# server = TSC.Server('https://SERVERURL')
#
...
# get the data source
datasource = server.datasources.get_by_id('1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b')
# get the connection information
server.datasources.populate_connections(datasource)
# print the information about the first connection item
connection = datasource.connections[0]
print(connection.connection_type)
print(connection.id)
print(connection.server_address)
...
相關用法
- Python Tableau datasources.publish用法及代碼示例
- Python Tableau datasources.get用法及代碼示例
- Python Tableau datasources.refresh用法及代碼示例
- Python Tableau datasources.get_by_id用法及代碼示例
- Python Tableau datasources.download用法及代碼示例
- Python Tableau datasources.update用法及代碼示例
- Python dataclasses.asdict用法及代碼示例
- Python dataclasses.dataclass用法及代碼示例
- Python dataclasses.astuple用法及代碼示例
- Python dataclasses.KW_ONLY用法及代碼示例
- Python dataclasses.field用法及代碼示例
- Python dataclasses.make_dataclass用法及代碼示例
- Python datetime timetuple()用法及代碼示例
- Python datetime astimezone()用法及代碼示例
- Python datetime.time.fromisoformat用法及代碼示例
- Python datetime timetz()用法及代碼示例
- Python datetime.utcoffset()用法及代碼示例
- Python date isoformat()用法及代碼示例
- Python datetime.datetime.fromisoformat用法及代碼示例
- Python datetime isocalendar()用法及代碼示例
- Python date toordinal()用法及代碼示例
- Python datetime轉date用法及代碼示例
- Python datetime.tzinfo()用法及代碼示例
- Python date strftime()用法及代碼示例
- Python datetime date()用法及代碼示例
注:本文由純淨天空篩選整理自tableau.github.io大神的英文原創作品 datasources.populate_connections。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。