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)

In Tableau server client i can able to print the site id based on the site id i need to print project and workbook.In the above code the user get the list of siteid's belongs to his role the user select the site id and i have stored in object "i" based on the site name how can i drill down to project and workbook.

vizyourdata
  • 1,338
  • 1
  • 17
  • 44

1 Answers1

-1

Here is how I do it after I have my 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)
vizyourdata
  • 1,338
  • 1
  • 17
  • 44
  • You are posting the same code for all asks. In a previous question, you posted similar code. The ask is can you "Drill Down" from site to project to workbook level. Not "List All" workbooks and sites and projects. – tkansara Aug 06 '21 at 17:57