Skip to content

Latest commit

 

History

History
269 lines (167 loc) · 4.98 KB

File metadata and controls

269 lines (167 loc) · 4.98 KB
title API reference
layout docs
Important: More coming soon! This section is under active construction and might not reflect all the available functionality of the TSC library. Until this reference is completed, we have noted the source files in the TSC library where you can get more information for individual endpoints.
  • TOC {:toc}

Authentication

Source files: server/endpoint/auth_endpoint.py, models/tableau_auth.py

Sign In

Signs you in to Tableau Server.

Auth.sign_in(authentication_object)

Sign Out

Signs you out of Tableau Server.

Auth.sign_out()

Sites

Source files: server/endpoint/sites_endpoint.py, models/site_item.py

Create Site

Creates a new site for the given site item object.

Sites.create(new_site_item)

Example:

new_site = TSC.SiteItem(name='Tableau', content_url='tableau', admin_mode=TSC.SiteItem.AdminMode.ContentAndUsers, user_quota=15, storage_quota=1000, disable_subscriptions=True)
self.server.sites.create(new_site)

Get Site by ID

Gets the site with the given ID.

Sites.get_by_id(id)

Get Sites

Gets the first 100 sites on the server. To get all the sites, use the Pager.

Sites.get()

Update Site

Modifies a site. The site item object must include the site ID and overrides all other settings.

Sites.update(site_item_object)

Delete Site

Deletes the site with the given ID.

Sites.delete(id)

Projects

Source files: server/endpoint/projects_endpoint.py

Create Project

Creates a project for the given project item object.

Projects.create(project_item_object)

Example:

new_project = TSC.ProjectItem(name='Test Project', description='Project created for testing')
new_project.content_permissions = 'ManagedByOwner'
self.server.projects.create(new_project)

Get Projects

Get the first 100 projects on the server. To get all projects, use the Pager.

Projects.get()

Update Project

Modifies a project. The project item object must include the project ID and overrides all other settings.

Projects.update(project_item_object)

Delete Project

Deletes a project by ID.

Projects.delete(id)

Workbooks

Source files: server/endpoint/workbooks.py, models/workbook_item.py

Get Workbooks

Get the first 100 workbooks on the server. To get all workbooks, use the Pager.

Workbooks.get()

Get Workbook by ID

Gets a workbook with a given ID.

Workbooks.get_by_id(id)

Publish Workbook

Publish a local workbook to Tableau Server.

Workbooks.publish(workbook_item, file_path, publish_mode)

Where the publish mode is one of the following:

  • Append
  • Overwrite
  • CreateNew

Example:

wb_item = TSC.WorkbookItem(name='Sample',
                           show_tabs=False,
                           project_id='ee8c6e70-43b6-11e6-af4f-f7b0d8e20760')

server.workbooks.publish(wb_item,
                         os.path.join(YOUR_DIR, 'SampleWB.twbx'),
                         self.server.PublishMode.CreateNew)

Update Workbook

Modifies a workbook. The workbook item object must include the workbook ID and overrides all other settings.

Workbooks.update(wb_item_object)

Update workbook connection

Updates a workbook connection string. The workbook connections must be populated before they strings can be updated.

Workbooks.update_conn(workbook, workbook.connections[0])

Delete Workbook

Deletes a workbook with the given ID.

Workbooks.delete(id)

Download Workbook

Downloads a workbook to the specified directory.

Workbooks.download(id, file_path)

Populate Views for a Workbook

Populates a list of views for a workbook object. You must populate views before you can iterate through the views.

Workbooks.populate_views(workbook_obj)

Populate Connections for a Workbook

Populates a list of connections for a given workbook. You must populate connections before you can iterate through the connections.

Workbooks.populate_connections(workbook_obj)

Populate a Preview Image for a Workbook

Populates a preview image for a given workbook. You must populate the image before you can iterate through the connections.

Workbooks.populate_connections(workbook_obj)

Get Views for a Workbook

Returns a list of views for a workbook. Before you get views, you must call populate_views.

workbook_obj.views

Get Connections for a Workbook

Returns a list of connections for a workbook. Before you get connections, you must call populate_connections.

workbook_obj.connections

Views

Source files: server/endpoint/views_endpoint.py, models/view_item.py

Data sources

Source files: server/endpoint/datasources_endpoint.py, models/datasource_item.py

Users

Source files: server/endpoint/users_endpoint.py, models/user_item.py

Groups

Source files: server/endpoint/groups_endpoint.py, models/group_item.py,