Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial documentation for TSC #98

Merged
merged 10 commits into from Nov 3, 2016
Merged

Initial documentation for TSC #98

merged 10 commits into from Nov 3, 2016

Conversation

jdomingu
Copy link
Contributor

@jdomingu jdomingu commented Nov 3, 2016

No description provided.

@t8y8
Copy link
Collaborator

t8y8 commented Nov 3, 2016

Few quick notes before I dive into the text details:

  • When we do eventually merge, please use 'Squash and Merge' so there's a single commit in the history
  • Check w/ @RussTheAerialist on the direct to master thing -- he and I experienced some pains today around this

Copy link
Collaborator

@t8y8 t8y8 left a comment

Choose a reason for hiding this comment

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

🚀
Lots of minor comments, I don't think any are necessarily blocking, but please consider them all. Especially some comments I have around what's really necessary to document and some things that are kinda mis-truths

<div class="content .col-xs-12 .col-sm-8 .col-md-9">
<h1>{{ page.title }}</h1>
<div class="edit-container">
<a href="https://github.com/tableau/server-client-python/edit/master/docs/docs/{{ page.path }}" class="edit-links"><span class="glyphicon glyphicon-pencil"></span> Edit this page</a>
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it docs/docs/ {{path}} I think in document-api it's just docs/{{path}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch. Copypasta problem :) Should be fixed.

---

<div class="alert alert-info">
<b>Important:</b> More coming soon! This section is under active construction and might not reflect all the available functionality of the TSC library.
Copy link
Collaborator

Choose a reason for hiding this comment

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

in the TSC library?? Maybe or. I think in :)


### Create Site

Creates a new site for the given site item object.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Big meta-question: Do we want to call them Item Objects, or just Objects? I vote latter. I know we call them SiteItem in the API but item object sounds redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll follow up with you all on this post-TC. I expect I'll be reworking all the API ref stuff.

Gets all the sites on the server.

```py
Sites.get()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not quite, get's 100 sites by default, or up to 1000 sites at a time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. Good call--I've added in that you need to use the pager.

Example:

```py
new_project = TSC.ProjectItem(name='Test Project', description='Project created for testing')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not set it when instantiating like name and description?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pulled in most of the examples from the test suite in the interest of time--I expect I'll be rewriting more cogent examples afterward. :(


* `create_group.py`. Create a user group.

* `create_schedules.py`. Create scheduled extract refresh tasks and subscription tasks.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This creates schedules, not tasks (currently)


* `create_schedules.py`. Create scheduled extract refresh tasks and subscription tasks.

* `explore_datasource.py`. Queries all datasources, selects a datasource, populates connections for the datasource, then updates the datasource.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actualllllly, no, doesn't get them all, doesn't use Pager


* `explore_datasource.py`. Queries all datasources, selects a datasource, populates connections for the datasource, then updates the datasource.

* `explore_workbook.py`. Queries all workbooks, selects a workbook, populates the connections and views for a workbook, then updates the workbook.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto


This code does the following things:

* Creates an authentication object that stores your user name and password.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Honest question: Does anyone care that it does all these things?

sign_in signs you in, sign_out signs you out.

You might want to note that it's a normal session, so it's got a time limit (2 hours, 4 hours, I forget)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Added a note about session length and cut the details.


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

print(server.version)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's always 2.3 by default, unless you change it to 2.4.

We don't auto detect or anything like that, so running code to discover this feels unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need to leave this in. Yes, it's hardcoded to 2.3 right now, but how would you know that if you ran pip install? You'd have to look at the source or run this command. This will be more useful when we have multiple releases as well.

Copy link
Collaborator

@t8y8 t8y8 Nov 3, 2016

Choose a reason for hiding this comment

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

Not sure how you installed the library matters, this is about the Server API version not the library's version.

I just filed #99 that would make this example useful, it's fine to leave it in, but I think you should also just have the note for now that it defaults to 2.3?

@jdomingu
Copy link
Contributor Author

jdomingu commented Nov 3, 2016

@RussTheAerialist Tyler mentioned that pushing direct to master caused some problems earlier? Any concerns I should now about?

@graysonarts
Copy link
Contributor

It's better to do it against development, but since we just took development into master, I think right now the two branches are effectively the same, so if we get this checked in before EOD Friday, I can just pull this into development immediately.

it's only a hassle when development has a bunch of changes in it that aren't in master

@jdomingu
Copy link
Contributor Author

jdomingu commented Nov 3, 2016

@RussTheAerialist Thanks for the explanation. I'll keep that in mind next time for sure.

@jdomingu jdomingu merged commit c4ed22e into tableau:master Nov 3, 2016
graysonarts pushed a commit that referenced this pull request Nov 3, 2016
* First cut at API docs

* Update jquery version for bootstrap compatibility

* Incorporate review feedback

* Add pagination docs

* Add dev guide

* Add docs for populating views and connections

* Continue adding to api ref

* Edits for existing content

* Update readme to point to docs

* Incorporate edits from PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants