@@ -176,26 +176,44 @@ def create_task_with_name(project, location, queue, task_name):
176176
177177
178178def delete_task (project , location , queue ):
179- # [START taskqueues_setup ]
179+ # [START taskqueues_deleting_tasks ]
180180 client = tasks .CloudTasksClient ()
181181
182182 # TODO(developer): Uncomment these lines and replace with your values.
183183 # project = 'my-project-id'
184184 # location = 'us- central1'
185185 # queue = 'queue1'
186- # [END taskqueues_setup]
187186
188- # [START taskqueues_deleting_tasks]
189187 task_path = client .task_path (project , location , queue , 'foo' )
190188 response = client .delete_task (task_path )
191189 # [END taskqueues_deleting_tasks]
190+ return response
192191
192+
193+ def purge_queue (project , location , queue ):
193194 # [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+
194202 queue_path = client .queue_path (project , location , queue )
195203 response = client .purge_queue (queue_path )
196204 # [END taskqueues_purging_tasks]
205+ return response
206+
197207
208+ def pause_queue (project , location , queue ):
198209 # [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+
199217 queue_path = client .queue_path (project , location , queue )
200218 response = client .pause_queue (queue_path )
201219 # [END taskqueues_pause_queues]
0 commit comments