Skip to content

Commit 09461c6

Browse files
Sarath Kaulgguuss
Sarath Kaul
authored andcommitted
Task Name in Creating HTTP Task with Token (GoogleCloudPlatform#2700)
1 parent 45f1353 commit 09461c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tasks/create_http_task_with_token.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def create_http_task(project,
2323
url,
2424
service_account_email,
2525
payload=None,
26-
in_seconds=None):
26+
in_seconds=None,
27+
task_name=None):
2728
# [START cloud_tasks_create_http_task_with_token]
2829
"""Create a task for a given queue with an arbitrary payload."""
2930

@@ -72,6 +73,10 @@ def create_http_task(project,
7273
# Add the timestamp to the tasks.
7374
task['schedule_time'] = timestamp
7475

76+
if task_name is not None:
77+
# Add the name to tasks.
78+
task['name'] = task_name
79+
7580
# Use the client to build and send the task.
7681
response = client.create_task(parent, task)
7782

0 commit comments

Comments
 (0)