diff --git a/samples/explore_datasource.py b/samples/explore_datasource.py index 434cadd3b..601e0f2b5 100644 --- a/samples/explore_datasource.py +++ b/samples/explore_datasource.py @@ -1,5 +1,5 @@ #### -# This script demonstrates how to use the Tableau Server API +# This script demonstrates how to use the Tableau Server Client # to interact with datasources. It explores the different # functions that the Server API supports on datasources. # @@ -43,7 +43,7 @@ if args.publish: if default_project is not None: new_datasource = TSC.DatasourceItem(default_project.id) - new_datasource = server.datasources.publish(new_datasource, args.publish, server.PublishMode.Overwrite) + new_datasource = server.datasources.publish(new_datasource, args.publish, TSC.Server.PublishMode.Overwrite) print("Datasource published. ID: {}".format(new_datasource.id)) else: print("Publish failed. Could not find the default project.") diff --git a/samples/explore_workbook.py b/samples/explore_workbook.py index 93897388e..35bd4222c 100644 --- a/samples/explore_workbook.py +++ b/samples/explore_workbook.py @@ -1,5 +1,5 @@ #### -# This script demonstrates how to use the Tableau Server API +# This script demonstrates how to use the Tableau Server Client # to interact with workbooks. It explores the different # functions that the Server API supports on workbooks. # @@ -45,7 +45,7 @@ if default_project is not None: new_workbook = TSC.WorkbookItem(default_project.id) - new_workbook = server.workbooks.publish(new_workbook, args.publish, server.PublishMode.Overwrite) + new_workbook = server.workbooks.publish(new_workbook, args.publish, TSC.Server.PublishMode.Overwrite) print("Workbook published. ID: {}".format(new_workbook.id)) else: print('Publish failed. Could not find the default project.') diff --git a/samples/move_workbook_projects.py b/samples/move_workbook_projects.py index 5e7835e72..3b553efb7 100644 --- a/samples/move_workbook_projects.py +++ b/samples/move_workbook_projects.py @@ -1,10 +1,10 @@ #### -# This script demonstrates how to use the Tableau Server API +# This script demonstrates how to use the Tableau Server Client # to move a workbook from one project to another. It will find # a workbook that matches a given name and update it to be in # the desired project. # -# To run the script, you must have installed Python 2.7.9 or later. +# To run the script, you must have installed Python 2.7.X or 3.3 and later. #### import tableauserverclient as TSC diff --git a/samples/move_workbook_sites.py b/samples/move_workbook_sites.py index 13103f82e..68904f3cf 100644 --- a/samples/move_workbook_sites.py +++ b/samples/move_workbook_sites.py @@ -1,10 +1,10 @@ #### -# This script demonstrates how to use the Tableau Server API +# This script demonstrates how to use the Tableau Server Client # to move a workbook from one site to another. It will find # a workbook that matches a given name, download the workbook, # and then publish it to the destination site. # -# To run the script, you must have installed Python 2.7.9 or later. +# To run the script, you must have installed Python 2.7.X or 3.3 and later. #### import tableauserverclient as TSC @@ -74,7 +74,7 @@ if target_project is not None: new_workbook = TSC.WorkbookItem(name=args.workbook_name, project_id=target_project.id) new_workbook = dest_server.workbooks.publish(new_workbook, workbook_path, - mode=dest_server.PublishMode.Overwrite) + mode=TSC.Server.PublishMode.Overwrite) print("Successfully moved {0} ({1})".format(new_workbook.name, new_workbook.id)) else: error = "The default project could not be found." diff --git a/samples/publish_workbook.py b/samples/publish_workbook.py index 266cd1b2e..6a720fc35 100644 --- a/samples/publish_workbook.py +++ b/samples/publish_workbook.py @@ -1,5 +1,5 @@ #### -# This script demonstrates how to use the Tableau Server API +# This script demonstrates how to use the Tableau Server Client # to publish a workbook to a Tableau server. It will publish # a specified workbook to the 'default' project of the given server. # @@ -11,7 +11,7 @@ # For more information, refer to the documentations on 'Publish Workbook' # (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm) # -# To run the script, you must have installed Python 2.7.9 or later. +# To run the script, you must have installed Python 2.7.X or 3.3 and later. #### import tableauserverclient as TSC @@ -45,7 +45,7 @@ # Step 3: If default project is found, form a new workbook item and publish. if default_project is not None: new_workbook = TSC.WorkbookItem(default_project.id) - new_workbook = server.workbooks.publish(new_workbook, args.filepath, server.PublishMode.Overwrite) + new_workbook = server.workbooks.publish(new_workbook, args.filepath, TSC.Server.PublishMode.Overwrite) print("Workbook published. ID: {0}".format(new_workbook.id)) else: error = "The default project could not be found." diff --git a/samples/set_http_options.py b/samples/set_http_options.py index 6700efb3e..dcec24428 100644 --- a/samples/set_http_options.py +++ b/samples/set_http_options.py @@ -2,10 +2,7 @@ # This script demonstrates how to set http options. It will set the option # to not verify SSL certificate, and query all workbooks on site. # -# For more information, refer to the documentation on 'Publish Workbook' -# (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm) -# -# To run the script, you must have installed Python 2.7.9 or later. +# To run the script, you must have installed Python 2.7.X or 3.3 and later. #### import tableauserverclient as TSC