Skip to content

Commit 87d6b31

Browse files
jorwoodsclaude
andcommitted
docs: add workbooks.add_tags, delete_tags, update_tags, update_connections, filter to api-ref.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3346fce commit 87d6b31

File tree

1 file changed

+166
-0
lines changed

1 file changed

+166
-0
lines changed

docs/api-ref.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6948,4 +6948,170 @@ result = server.workbooks.schedule_extract_refresh('schedule-id-here', workbook)
69486948
<br>
69496949
<br>
69506950

6951+
#### workbooks.update_connections
6952+
6953+
```py
6954+
workbooks.update_connections(workbook_item, connection_luids, authentication_type, username=None, password=None, embed_password=None)
6955+
```
6956+
6957+
Bulk updates one or more workbook connections by LUID, including the authentication type, username, password, and whether to embed the password.
6958+
6959+
**Parameters**
6960+
6961+
Name | Description
6962+
:--- | :---
6963+
`workbook_item` | The `WorkbookItem` containing the connections to update.
6964+
`connection_luids` | An iterable of connection LUIDs (strings) to update.
6965+
`authentication_type` | The authentication type to use (e.g., `'AD Service Principal'`).
6966+
`username` | (Optional) The username to set (e.g., client ID for keypair auth).
6967+
`password` | (Optional) The password or secret to set.
6968+
`embed_password` | (Optional) Whether to embed the password.
6969+
6970+
**Returns**
6971+
6972+
Returns a list of updated `ConnectionItem` objects.
6973+
6974+
**Example**
6975+
6976+
```py
6977+
workbook = server.workbooks.get_by_id('1a2a3b4b-5c6c-7d8d-9e0e-1f2f3a4a5b6b')
6978+
server.workbooks.populate_connections(workbook)
6979+
luids = [conn.id for conn in workbook.connections]
6980+
updated = server.workbooks.update_connections(workbook, luids, 'UserNameAndPassword', username='myuser', password='mypassword', embed_password=True)
6981+
```
6982+
6983+
<br>
6984+
<br>
6985+
6986+
#### workbooks.add_tags
6987+
6988+
```py
6989+
workbooks.add_tags(item, tags)
6990+
```
6991+
6992+
Adds one or more tags to the specified workbook.
6993+
6994+
REST API: [Add Tags to Workbook](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_workbooks_and_views.htm#add_tags_to_workbook)
6995+
6996+
**Parameters**
6997+
6998+
Name | Description
6999+
:--- | :---
7000+
`item` | The `WorkbookItem` or workbook ID to add tags to.
7001+
`tags` | A single tag string or iterable of tag strings to add.
7002+
7003+
**Returns**
7004+
7005+
Returns a `set[str]` of the tags added.
7006+
7007+
**Example**
7008+
7009+
```py
7010+
server.workbooks.add_tags(workbook_item, ['finance', 'quarterly'])
7011+
```
7012+
7013+
<br>
7014+
<br>
7015+
7016+
#### workbooks.delete_tags
7017+
7018+
```py
7019+
workbooks.delete_tags(item, tags)
7020+
```
7021+
7022+
Removes one or more tags from the specified workbook.
7023+
7024+
REST API: [Delete Tag from Workbook](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_workbooks_and_views.htm#delete_tag_from_workbook)
7025+
7026+
**Parameters**
7027+
7028+
Name | Description
7029+
:--- | :---
7030+
`item` | The `WorkbookItem` or workbook ID to remove tags from.
7031+
`tags` | A single tag string or iterable of tag strings to remove.
7032+
7033+
**Returns**
7034+
7035+
None.
7036+
7037+
**Example**
7038+
7039+
```py
7040+
server.workbooks.delete_tags(workbook_item, 'finance')
7041+
```
7042+
7043+
<br>
7044+
<br>
7045+
7046+
#### workbooks.update_tags
7047+
7048+
```py
7049+
workbooks.update_tags(item)
7050+
```
7051+
7052+
Updates the tags on the server to match the tags on the specified workbook item. Changes to tags must be made on the `WorkbookItem.tags` attribute before calling this method.
7053+
7054+
**Parameters**
7055+
7056+
Name | Description
7057+
:--- | :---
7058+
`item` | The `WorkbookItem` whose tags to synchronize to the server.
7059+
7060+
**Returns**
7061+
7062+
None.
7063+
7064+
**Example**
7065+
7066+
```py
7067+
workbook_item.tags.add('quarterly')
7068+
server.workbooks.update_tags(workbook_item)
7069+
```
7070+
7071+
<br>
7072+
<br>
7073+
7074+
#### workbooks.filter
7075+
7076+
```py
7077+
workbooks.filter(**kwargs)
7078+
```
7079+
7080+
Returns a list of workbooks that match the specified filters. Fields and operators are passed as keyword arguments in the form `field_name=value` or `field_name__operator=value`.
7081+
7082+
**Supported fields and operators**
7083+
7084+
Field | Operators
7085+
:--- | :---
7086+
`content_url` | `eq`, `in`
7087+
`created_at` | `eq`, `gt`, `gte`, `lt`, `lte`
7088+
`display_tabs` | `eq`
7089+
`favorites_total` | `eq`, `gt`, `gte`, `lt`, `lte`
7090+
`has_alerts` | `eq`
7091+
`has_extracts` | `eq`
7092+
`name` | `eq`, `in`
7093+
`owner_domain` | `eq`, `in`
7094+
`owner_email` | `eq`, `in`
7095+
`owner_name` | `eq`, `in`
7096+
`project_name` | `eq`, `in`
7097+
`sheet_count` | `eq`, `gt`, `gte`, `lt`, `lte`
7098+
`size` | `eq`, `gt`, `gte`, `lt`, `lte`
7099+
`subscriptions_total` | `eq`, `gt`, `gte`, `lt`, `lte`
7100+
`tags` | `eq`, `in`
7101+
`updated_at` | `eq`, `gt`, `gte`, `lt`, `lte`
7102+
7103+
**Returns**
7104+
7105+
Returns a `QuerySet` of `WorkbookItem` objects.
7106+
7107+
**Example**
7108+
7109+
```py
7110+
finance_workbooks = server.workbooks.filter(project_name='Finance', has_extracts=True)
7111+
for wb in finance_workbooks:
7112+
print(wb.name)
7113+
```
7114+
7115+
<br>
7116+
<br>
69517117

0 commit comments

Comments
 (0)