@@ -176,26 +176,44 @@ def create_task_with_name(project, location, queue, task_name):
176
176
177
177
178
178
def delete_task (project , location , queue ):
179
- # [START taskqueues_setup ]
179
+ # [START taskqueues_deleting_tasks ]
180
180
client = tasks .CloudTasksClient ()
181
181
182
182
# TODO(developer): Uncomment these lines and replace with your values.
183
183
# project = 'my-project-id'
184
184
# location = 'us- central1'
185
185
# queue = 'queue1'
186
- # [END taskqueues_setup]
187
186
188
- # [START taskqueues_deleting_tasks]
189
187
task_path = client .task_path (project , location , queue , 'foo' )
190
188
response = client .delete_task (task_path )
191
189
# [END taskqueues_deleting_tasks]
190
+ return response
192
191
192
+
193
+ def purge_queue (project , location , queue ):
193
194
# [START taskqueues_purging_tasks]
195
+ client = tasks .CloudTasksClient ()
196
+
197
+ # TODO(developer): Uncomment these lines and replace with your values.
198
+ # project = 'my-project-id'
199
+ # location = 'us- central1'
200
+ # queue = 'queue1'
201
+
194
202
queue_path = client .queue_path (project , location , queue )
195
203
response = client .purge_queue (queue_path )
196
204
# [END taskqueues_purging_tasks]
205
+ return response
206
+
197
207
208
+ def pause_queue (project , location , queue ):
198
209
# [START taskqueues_pause_queue]
210
+ client = tasks .CloudTasksClient ()
211
+
212
+ # TODO(developer): Uncomment these lines and replace with your values.
213
+ # project = 'my-project-id'
214
+ # location = 'us- central1'
215
+ # queue = 'queue1'
216
+
199
217
queue_path = client .queue_path (project , location , queue )
200
218
response = client .pause_queue (queue_path )
201
219
# [END taskqueues_pause_queues]
0 commit comments