0
     SIGN IN
    tableau_auth = TSC.TableauAuth(args.username, password, args.site)
    server = TSC. Server(args.server, use_server_version=True)
    with server.auth.sign_in(tableau_auth):
        print("Your server contains the following sites:")
        for site in TSC.Pager(server.sites.get):
            print(site.name)
        i=input("Enter the site name :")
        print(i)
    for project in TSC.Pager(server.sites.projects.get):
        print(project.name)

在 Tableau Server 客户端中,我可以根据需要打印项目和工作簿的站点 ID 打印站点 ID。在上面的代码中,用户获取站点 ID 的列表属于他的角色,用户选择站点 ID 并且我已经存储在基于站点名称的对象“i”中,我如何深入到项目和工作簿。

4

1 回答 1

-1

这是我获得 site_id 后的操作方法

auth = TSC.TableauAuth('username', 'password', site_id=i)
server = TSC.Server(serverAddress) 
with server.auth.sign_in(auth):
    all_project_items, pagination_item = server.projects.get()
    for proj in all_project_items:
        print(proj.id)

    all_workbooks, pagination_item = server.workbooks.get()
    for workbook in all_workbooks:
        print(workbook.name)
于 2019-12-20T22:14:35.370 回答