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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ $RECYCLE.BIN/
# Documentation
docs/_site/
docs/.jekyll-metadata
docs/Gemfile.lock
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ script:
# Tests
- python setup.py test
# pep8 - disabled for now until we can scrub the files to make sure we pass before turning it on
- pycodestyle tableauserverclient test
- pycodestyle tableauserverclient test samples
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
## 0.5.1 (21 Sept 2017
## 0.6 (17 Jan 2018)

* Added support for add a datasource/workbook refresh to a schedule (#244)
* Added support for updating datasource connections (#253)
* Added Refresh Now for datasource and workbooks (#250)
* Fixed Typos in the docs (#251)

## 0.5.1 (21 Sept 2017)

* Fix a critical issue caused by #224 that was the result of lack of test coverage (#226)

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The following people have contributed to this project to make it possible, and w
* [Russ Goldin](https://github.com/tagyoureit)
* [William Lang](https://github.com/williamlang)
* [Jim Morris](https://github.com/jimbodriven)
* [BingoDinkus](https://github.com/BingoDinkus)

## Core Team

Expand Down
129 changes: 0 additions & 129 deletions docs/Gemfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion docs/docs/api-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -2575,7 +2575,7 @@ server = TSC.Server('http://servername')

with server.auth.sign_in(tableau_auth):
all_workbook_items, pagination_item = server.workbooks.get()
print([workbook.name for workbook in all_workbooks])
print([workbook.name for workbook in all_workbook_items])



Expand Down
8 changes: 7 additions & 1 deletion docs/docs/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ import tableauserverclient as TSC

server = TSC.Server('http://SERVER_URL')

server.version = '2.4'

server.version = '2.6'



```

## Supported versions
Expand All @@ -43,3 +47,5 @@ The current version of TSC only supports the following REST API and Tableau Serv
|---|---|
|2.3|10.0|
|2.4|10.1|
|2.5|10.2|
|2.6|10.3|
2 changes: 2 additions & 0 deletions samples/create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def create_project(server, project_item):
print('We have already created this project: %s' % project_item.name)
sys.exit(1)


def main():
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
parser.add_argument('--server', '-s', required=True, help='server address')
Expand Down Expand Up @@ -64,5 +65,6 @@ def main():
grand_child_project = TSC.ProjectItem(name='Grand Child Project', parent_id=child_project.id)
grand_child_project = create_project(server, grand_child_project)


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions samples/download_view_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ def main():

print("View image saved to {0}".format(args.filepath))


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions samples/explore_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ def main():
sample_datasource.tags = original_tag_set
server.datasources.update(sample_datasource)


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions samples/filter_sort_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ def main():
for group in matching_groups:
print(group.name)


if __name__ == '__main__':
main()
51 changes: 51 additions & 0 deletions samples/list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
####
# This script demonstrates how to list all of the workbooks or datasources
#
# To run the script, you must have installed Python 2.7.X or 3.3 and later.
####

import argparse
import getpass
import logging

import tableauserverclient as TSC


def main():
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
parser.add_argument('--site', '-S', default=None)
parser.add_argument('-p', default=None)

parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')

parser.add_argument('resource_type', choices=['workbook', 'datasource'])

args = parser.parse_args()

if args.p is None:
password = getpass.getpass("Password: ")
else:
password = args.p

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

# 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):
endpoint = {
'workbook': server.workbooks,
'datasource': server.datasources
}.get(args.resource_type)

for resource in TSC.Pager(endpoint.get):
print(resource.id, resource.name)


if __name__ == '__main__':
main()
54 changes: 54 additions & 0 deletions samples/refresh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
####
# This script demonstrates how to use trigger a refresh on a datasource or workbook
#
# To run the script, you must have installed Python 2.7.X or 3.3 and later.
####

import argparse
import getpass
import logging

import tableauserverclient as TSC


def main():
parser = argparse.ArgumentParser(description='Get all of the refresh tasks available on a server')
parser.add_argument('--server', '-s', required=True, help='server address')
parser.add_argument('--username', '-u', required=True, help='username to sign into server')
parser.add_argument('--site', '-S', default=None)
parser.add_argument('-p', default=None)

parser.add_argument('--logging-level', '-l', choices=['debug', 'info', 'error'], default='error',
help='desired logging level (set to error by default)')

parser.add_argument('resource_type', choices=['workbook', 'datasource'])
parser.add_argument('resource_id')

args = parser.parse_args()

if args.p is None:
password = getpass.getpass("Password: ")
else:
password = args.p

# Set logging level based on user input, or error by default
logging_level = getattr(logging, args.logging_level.upper())
logging.basicConfig(level=logging_level)

# 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):
endpoint = {
'workbook': server.workbooks,
'datasource': server.datasources
}.get(args.resource_type)

refresh_func = endpoint.refresh
resource = endpoint.get_by_id(args.resource_id)

print(refresh_func(resource))


if __name__ == '__main__':
main()
Loading