Skip to content

Commit 1a9e80e

Browse files
authored
docs: document tasks endpoint (#1758)
1 parent e1d0500 commit 1a9e80e

1 file changed

Lines changed: 44 additions & 2 deletions

File tree

docs/api-ref.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5778,8 +5778,50 @@ Error | Description
57785778

57795779
```
57805780

5781-
<br>
5782-
<br>
5781+
<br>
5782+
<br>
5783+
5784+
#### tasks.create
5785+
5786+
```py
5787+
tasks.create(extract_item)
5788+
```
5789+
5790+
Creates a custom schedule for an extract refresh on Tableau Cloud. For Tableau Server, use the Schedules endpoint to create a schedule.
5791+
5792+
**Parameters**
5793+
5794+
Name | Description
5795+
:--- | :---
5796+
`extract_item` | The `TaskItem` specifying the extract refresh task to create. The task item must have the target workbook or datasource set.
5797+
5798+
**Exceptions**
5799+
5800+
Error | Description
5801+
:--- | :---
5802+
`ValueError` | Raises an exception if no extract item is provided.
5803+
5804+
**Returns**
5805+
5806+
Returns the created `TaskItem`.
5807+
5808+
**Version**
5809+
5810+
Version 3.19 and later. See [REST API versions](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_versions.htm).
5811+
5812+
**Example**
5813+
5814+
```py
5815+
import tableauserverclient as TSC
5816+
5817+
task_item = TSC.TaskItem(TSC.TaskItem.Type.ExtractRefresh)
5818+
task_item.target = TSC.Target(datasource_id, 'datasource')
5819+
new_task = server.tasks.create(task_item)
5820+
print("Created task ID: {}".format(new_task.id))
5821+
```
5822+
5823+
<br>
5824+
<br>
57835825

57845826

57855827
---

0 commit comments

Comments
 (0)