Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/explore_datasource.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
####
# This script demonstrates how to use the Tableau Server API
# This script demonstrates how to use the Tableau Server Client
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Catch

# to interact with datasources. It explores the different
# functions that the Server API supports on datasources.
#
Expand Down Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions samples/explore_workbook.py
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down Expand Up @@ -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.')
Expand Down
4 changes: 2 additions & 2 deletions samples/move_workbook_projects.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions samples/move_workbook_sites.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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."
Expand Down
6 changes: 3 additions & 3 deletions samples/publish_workbook.py
Original file line number Diff line number Diff line change
@@ -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.
#
Expand All @@ -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
Expand Down Expand Up @@ -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."
Expand Down
5 changes: 1 addition & 4 deletions samples/set_http_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down