|
59 | 59 |
|
60 | 60 |
|
61 | 61 | class Server: |
| 62 | + """ |
| 63 | + In the Tableau REST API, the server (https://MY-SERVER/) is the base or core |
| 64 | + of the URI that makes up the various endpoints or methods for accessing |
| 65 | + resources on the server (views, workbooks, sites, users, data sources, etc.) |
| 66 | + The TSC library provides a Server class that represents the server. You |
| 67 | + create a server instance to sign in to the server and to call the various |
| 68 | + methods for accessing resources. |
| 69 | +
|
| 70 | + The Server class contains the attributes that represent the server on |
| 71 | + Tableau Server. After you create an instance of the Server class, you can |
| 72 | + sign in to the server and call methods to access all of the resources on the |
| 73 | + server. |
| 74 | +
|
| 75 | + Parameters |
| 76 | + ---------- |
| 77 | + server_address : str |
| 78 | + Specifies the address of the Tableau Server or Tableau Cloud (for |
| 79 | + example, https://MY-SERVER/). |
| 80 | +
|
| 81 | + use_server_version : bool |
| 82 | + Specifies the version of the REST API to use (for example, '2.5'). When |
| 83 | + you use the TSC library to call methods that access Tableau Server, the |
| 84 | + version is passed to the endpoint as part of the URI |
| 85 | + (https://MY-SERVER/api/2.5/). Each release of Tableau Server supports |
| 86 | + specific versions of the REST API. New versions of the REST API are |
| 87 | + released with Tableau Server. By default, the value of version is set to |
| 88 | + '2.3', which corresponds to Tableau Server 10.0. You can view or set |
| 89 | + this value. You might need to set this to a different value, for |
| 90 | + example, if you want to access features that are supported by the server |
| 91 | + and a later version of the REST API. For more information, see REST API |
| 92 | + Versions. |
| 93 | +
|
| 94 | + Examples |
| 95 | + -------- |
| 96 | + >>> import tableauserverclient as TSC |
| 97 | +
|
| 98 | + >>> # create a instance of server |
| 99 | + >>> server = TSC.Server('https://MY-SERVER') |
| 100 | +
|
| 101 | + >>> # sign in, etc. |
| 102 | +
|
| 103 | + >>> # change the REST API version to match the server |
| 104 | + >>> server.use_server_version() |
| 105 | +
|
| 106 | + >>> # or change the REST API version to match a specific version |
| 107 | + >>> # for example, 2.8 |
| 108 | + >>> # server.version = '2.8' |
| 109 | +
|
| 110 | + """ |
| 111 | + |
62 | 112 | class PublishMode: |
| 113 | + """ |
| 114 | + Enumerates the options that specify what happens when you publish a |
| 115 | + workbook or data source. The options are Overwrite, Append, or |
| 116 | + CreateNew. |
| 117 | + """ |
| 118 | + |
63 | 119 | Append = "Append" |
64 | 120 | Overwrite = "Overwrite" |
65 | 121 | CreateNew = "CreateNew" |
|
0 commit comments