8000 refactor site-id terminology · rmagier1/server-client-python@3444d2f · GitHub
[go: up one dir, main page]

Skip to content

Commit 3444d2f

Browse files
committed
refactor site-id terminology
1 parent cedd305 commit 3444d2f

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

docs/api-ref.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Name | Description
5050
:--- | :---
5151
`username` | The name of the user whose credentials will be used to sign in.
5252
`password` | The password of the user.
53-
`site_id` | This corresponds to the `contentUrl` attribute in the Tableau REST API. The `site_id` is the portion of the URL that follows the `/site/` in the URL. For example, "MarketingTeam" is the `site_id` in the following URL *MyServer*/#/site/**MarketingTeam**/projects. To specify the default site on Tableau Server, you can use an empty string `''` (single quotes, no space). For Tableau Online, you must provide a value for the `site_id`.
53+
`site_id` | This corresponds to the `contentUrl` attribute in the Tableau REST API. It is the portion of the URL that follows the `/site/` in the URL. For example, "MarketingTeam" is the `site_id` in the following URL: `https://MyServer/#/site/MarketingTeam/projects`. To specify the default site on Tableau Server, you can either omit the site_id or use an empty string `''` (single quotes, no space). For Tableau Online, you must provide a value for the `site_id`.
5454
`user_id_to_impersonate` | Specifies the id (not the name) of the user to sign in as.
5555

5656
Source file: models/tableau_auth.py
@@ -61,7 +61,7 @@ Source file: models/tableau_auth.py
6161
import tableauserverclient as TSC
6262
# create a new instance of a TableauAuth object for authentication
6363

64-
tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD', site_id='CONTENTURL')
64+
tableau_auth = TSC.TableauAuth('username', 'password', 'site-id')
6565

6666
# create a server instance
6767
# pass the "tableau_auth" object to the server.auth.sign_in() method
@@ -103,10 +103,10 @@ REST API: [Sign In](https://onlinehelp.tableau.com/current/api/rest_api/en-us/RE
103103
import tableauserverclient as TSC
104104

105105
# create an auth object
106-
tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD')
106+
tableau_auth = TSC.TableauAuth('username', 'password')
107107

108108
# create an instance for your server
109-
server = TSC.Server('https://SERVER_URL')
109+
server = TSC.Server('https://serverurl')
110110

111111
# call the sign-in method with the auth object
112112
server.auth.sign_in(tableau_auth)
@@ -2118,8 +2118,8 @@ The `SiteItem` class contains the members or attributes for the site resources o
21182118

21192119
Attribute | Description
21202120
:--- | :---
2121-
`name` | The name of the site. The name of the default site is "".
2122-
`content_url` | The path to the site.
2121+
`name` | The display name of the site, as shown in the Site dropdown of the left hand menu of the Tableau server. For the name of the default site use an empty string: `""`.
2122+
`content_url` | The name of the subpath of your site URL, as it shows in a browser address bar.
21232123
`admin_mode` | (Optional) For Tableau Server only. Specify `ContentAndUsers` to allow site administrators to use the server interface and **tabcmd** commands to add and remove users. (Specifying this option does not give site administrators permissions to manage users using the REST API.) Specify `ContentOnly` to prevent site administrators from adding or removing users. (Server administrators can always add or remove users.)
21242124
`user_quota`| (Optional) Specifies the maximum number of users for the site. If you do not specify this value, the limit depends on the type of licensing configured for the server. For user-based license, the maximum number of users is set by the license. For core-based licensing, there is no limit to the number of users. If you specify a maximum value, only licensed users are counted and server administrators are excluded.
21252125
`storage_quota` | (Optional) Specifies the maximum amount of space for the new site, in megabytes. If you set a quota and the site exceeds it, publishers will be prevented from uploading new content until the site is under the limit again.
@@ -2249,7 +2249,7 @@ Returns a list of all `SiteItem` objects and a `PaginationItem`. Use these value
22492249
#### sites.get_by_id
22502250

22512251
```py
2252-
sites.get_by_id(site_id)
2252+
sites.get_by_id(site_luid)
22532253
```
22542254

22552255
Queries the site with the given ID.
@@ -2261,7 +2261,7 @@ REST API: [Query Site](https://onlinehelp.tableau.com/current/api/rest_api/en-u
22612261

22622262
Name | Description
22632263
:--- | :---
2264-
`site_id` | The id for the site you want to query.
2264+
`site_luid` | The unique identifier for the site that you want to remove from the server. You can find a sites's LUID by making a [sites.get](#sitesget) request.
22652265

22662266

22672267
**Exceptions**
@@ -2307,7 +2307,7 @@ REST API: [Query Site](https://onlinehelp.tableau.com/current/api/rest_api/en-u
23072307

23082308
Name | Description
23092309
:--- | :---
2310-
`site_name` | The name of the site you want to query.
2310+
`site_name` | The display name of the site you want to query, as shown in the Site dropdown in the left hand menu of the server.
23112311

23122312

23132313
**Exceptions**
@@ -2330,7 +2330,7 @@ Returns the `SiteItem`.
23302330
# server = TSC.Server('https://MY-SERVER')
23312331
# sign in, etc.
23322332

2333-
a_site = server.sites.get_by_name('MY_SITE')
2333+
a_site = server.sites.get_by_name('MY SITE NAME')
23342334

23352335

23362336
```
@@ -2399,7 +2399,7 @@ site_item = server.sites.update(site_item)
23992399

24002400

24012401
```py
2402-
Sites.delete(site_id)
2402+
Sites.delete(site_luid)
24032403
```
24042404

24052405
Deletes the specified site.
@@ -2412,15 +2412,16 @@ REST API: [Delete Site](https://onlinehelp.tableau.com/current/api/rest_api/en-u
24122412

24132413
Name | Description
24142414
:--- | : ---
2415-
`site_id` | The id of the site that you want to delete.
2415+
`site_luid` | The unique identifier for the site that you want to remove from the server. You can find a sites's LUID by making a [sites.get](#sitesget) request.
2416+
24162417

24172418

24182419

24192420
**Exceptions**
24202421

24212422
Error | Description
24222423
:--- | :---
2423-
`Site ID Undefined.` | The site id must be present and must match the id of the site you are deleting.
2424+
`Site ID Undefined.` | The site id must be present and must match the LUID of the site you are deleting.
24242425

24252426

24262427

@@ -2508,7 +2509,7 @@ SubscriptionItem(subject, schedule_id, user_id, target)
25082509

25092510
Name | Description
25102511
:--- | :---
2511-
`id` | The id of the subscription on the site.
2512+
`id` | The unique ID of the subscription on the site.
25122513
`subject`| The subject of the subscription. This is the description that you provide to identify the subscription.
25132514
`schedule_id` | The identifier associated with the specific subscription.
25142515
`user_id` | The identifier of the user (person) who receives the subscription.
@@ -2608,7 +2609,7 @@ REST API: [Delete Subscription](https://onlinehelp.tableau.com/current/api/rest_
26082609

26092610
Name | Description
26102611
:--- | : ---
2611-
`subscription_id` | The identifier (`id`) for the subscription that you want to remove from the site.
2612+
`subscription_id` | The unique identifier for the subscription that you want to remove from the site. You can find a subscription's LUID by making a [subscription.get](#subscriptionget) request.
26122613

26132614

26142615
**Exceptions**
@@ -3493,7 +3494,7 @@ Returns a list of all `WorkbookItem` objects and a `PaginationItem`. Use these v
34933494
```py
34943495

34953496
import tableauserverclient as TSC
3496-
tableau_auth = TSC.TableauAuth('username', 'password', site_id='site')
3497+
tableau_auth = TSC.TableauAuth('username', 'password', 'site-id')
34973498
server = TSC.Server('https://servername')
34983499

34993500
with server.auth.sign_in(tableau_auth):
@@ -3605,7 +3606,7 @@ The `WorkbookItem` for the workbook that was published.
36053606
```py
36063607

36073608
import tableauserverclient as TSC
3608-
tableau_auth = TSC.TableauAuth('username', 'password', site_id='site')
3609+
tableau_auth = TSC.TableauAuth('username', 'password', 'site-id')
36093610
server = TSC.Server('https://servername')
36103611

36113612
with server.auth.sign_in(tableau_auth):
@@ -3728,7 +3729,7 @@ Deletes a workbook with the specified ID.
37283729

37293730

37303731

3731-
To specify the site, create a `TableauAuth` instance using the content URL for the site (`site_id`), and sign in to that site. See the [TableauAuth class](#tableauauth-class).
3732+
To specify the site, create a `TableauAuth` instance `site-id` (the subpath of your full site URL, also called `contentURL` in the REST API), and sign in to that site. See the [TableauAuth class](#tableauauth-class).
37323733

37333734

37343735
REST API: [Delete Workbook](https://onlinehelp.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#Delete_Workbook31){:target="_blank"}

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ Run the following code to get a list of all the data sources on your installatio
7676
```py
7777
import tableauserverclient as TSC
7878

79-
tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD', 'SITENAME')
79+
tableau_auth = TSC.TableauAuth('username', 'password', 'site-id')
8080
server = TSC.Server('http://SERVER_URL')
8181

8282
with server.auth.sign_in(tableau_auth):
8383
all_datasources, pagination_item = server.datasources.get()
8484
print("\nThere are {} datasources on site: ".format(pagination_item.total_available))
8585
print([datasource.name for datasource in all_datasources])
8686
```
87-
> `SERVER_URL` is the URL of your Tableau server without subpaths. For local Tableau servers, an example would be: `https://www.MY_SERVER.com`. For Tableau Online, an example would be: `https://10ax.online.tableau.com/`.
87+
> `serverurl` is the URL of your Tableau server without subpaths. For local Tableau servers, an example would be: `https://www.MY_SERVER.com`. For Tableau Online, an example would be: `https://10ax.online.tableau.com/`.
8888
89-
>`SITENAME` is the subpath of your full site URL (also called `contentURL` in the REST API). `MYSITE` would be the site name of `https://10ax.online.tableau.com/MYSITE`. This parameter can be omitted when signing in to the Default site of a on premise Tableau server.
89+
>`site-id` is the subpath of your full site URL (also called `contentURL` in the REST API). `MYSITE` would be the site name of `https://10ax.online.tableau.com/MYSITE`. This parameter can be omitted when signing in to the Default site of a on premise Tableau server.

0 commit comments

Comments
 (0)
0