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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。