@@ -31,6 +31,24 @@ def __normalize_task_type(self, task_type: str) -> str:
31
31
def get (
32
32
self , req_options : Optional ["RequestOptions" ] = None , task_type : str = TaskItem .Type .ExtractRefresh
33
33
) -> tuple [list [TaskItem ], PaginationItem ]:
34
+ """
35
+ Returns information about tasks on the specified site.
36
+
37
+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_jobs_tasks_and_schedules.htm#list_extract_refresh_tasks
38
+
39
+ Parameters
40
+ ----------
41
+ req_options : RequestOptions, optional
42
+ Options for the request, such as filtering, sorting, and pagination.
43
+
44
+ task_type : str, optional
45
+ The type of task to query. See TaskItem.Type for possible values.
46
+
47
+ Returns
48
+ -------
49
+ tuple[list[TaskItem], PaginationItem]
50
+
51
+ """
34
52
if task_type == TaskItem .Type .DataAcceleration :
35
53
self .parent_srv .assert_at_least_version ("3.8" , "Data Acceleration Tasks" )
36
54
@@ -45,6 +63,20 @@ def get(
45
63
46
64
@api (version = "2.6" )
47
65
def get_by_id (self , task_id : str ) -> TaskItem :
66
+ """
67
+ Returns information about the specified task.
68
+
69
+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_jobs_tasks_and_schedules.htm#get_extract_refresh_task
70
+
71
+ Parameters
72
+ ----------
73
+ task_id : str
74
+ The ID of the task to query.
75
+
76
+ Returns
77
+ -------
78
+ TaskItem
79
+ """
48
80
if not task_id :
49
81
error = "No Task ID provided"
50
82
raise ValueError (error )
@@ -59,6 +91,21 @@ def get_by_id(self, task_id: str) -> TaskItem:
59
91
60
92
@api (version = "3.19" )
61
93
def create (self , extract_item : TaskItem ) -> TaskItem :
94
+ """
95
+ Creates a custom schedule for an extract refresh on Tableau Cloud. For
96
+ Tableau Server, use the Schedules endpoint to create a schedule.
97
+
98
+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#create_cloud_extract_refresh_task
99
+
100
+ Parameters
101
+ ----------
102
+ extract_item : TaskItem
103
+ The extract refresh task to create.
104
+
105
+ Returns
106
+ -------
107
+ TaskItem
108
+ """
62
109
if not extract_item :
63
110
error = "No extract refresh provided"
64
111
raise ValueError (error )
@@ -70,6 +117,20 @@ def create(self, extract_item: TaskItem) -> TaskItem:
70
117
71
118
@api (version = "2.6" )
72
119
def run (self , task_item : TaskItem ) -> bytes :
120
+ """
121
+ Runs the specified extract refresh task.
122
+
123
+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_jobs_tasks_and_schedules.htm#run_extract_refresh_task
124
+
125
+ Parameters
126
+ ----------
127
+ task_item : TaskItem
128
+ The task to run.
129
+
130
+ Returns
131
+ -------
132
+ bytes
133
+ """
73
134
if not task_item .id :
74
135
error = "Task item missing ID."
75
136
raise MissingRequiredFieldError (error )
@@ -86,6 +147,23 @@ def run(self, task_item: TaskItem) -> bytes:
86
147
# Delete 1 task by id
87
148
@api (version = "3.6" )
88
149
def delete (self , task_id : str , task_type : str = TaskItem .Type .ExtractRefresh ) -> None :
150
+ """
151
+ Deletes the specified extract refresh task on Tableau Server or Tableau Cloud.
152
+
153
+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#delete_extract_refresh_task
154
+
155
+ Parameters
156
+ ----------
157
+ task_id : str
158
+ The ID of the task to delete.
159
+
160
+ task_type : str, default TaskItem.Type.ExtractRefresh
161
+ The type of task to query. See TaskItem.Type for possible values.
162
+
163
+ Returns
164
+ -------
165
+ None
166
+ """
89
167
if task_type == TaskItem .Type .DataAcceleration :
90
168
self .parent_srv .assert_at_least_version ("3.8" , "Data Acceleration Tasks" )
91
169
0 commit comments