Skip to content

Commit b6248fe

Browse files
committed
update comments
1 parent 02e2b36 commit b6248fe

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

appengine/flexible/tasks/README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
66
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=appengine/flexible/tasks/README.md
77

8-
Sample command-line program for interacting with the Cloud Tasks API
9-
using App Engine queues.
8+
Sample command-line programs for interacting with the Cloud Tasks API
9+
.
1010

1111
App Engine queues push tasks to an App Engine HTTP target. This directory
1212
contains both the App Engine app to deploy, as well as the snippets to run
@@ -94,14 +94,29 @@ location is "us-central1").
9494
```
9595
export LOCATION_ID=us-central1
9696
```
97-
98-
Running the sample will create a task, targeted at the 'example_task_handler'
97+
### Using App Engine Queues
98+
Running the sample will create a task, targeted at the `/example_task_handler`
9999
endpoint, with a payload specified:
100100

101101
```
102102
python create_app_engine_queue_task.py --project=$PROJECT_ID --queue=$QUEUE_ID --location=$LOCATION_ID --payload=hello
103103
```
104104

105+
### Using HTTP Push Queues
106+
107+
Set an environment variable for the endpoint to your task handler. This is an
108+
example url to send requests to the App Engine task handler:
109+
```
110+
export URL=https://<project_id>.appspot.com/example_task_handler
111+
```
112+
113+
Running the sample will create a task and send the task to the specific URL
114+
endpoint, with a payload specified:
115+
116+
```
117+
python create_http_task.py --project=$PROJECT_ID --queue=$QUEUE_ID --location=$LOCATION_ID --url=$URL --payload=hello
118+
```
119+
105120
Now view that the payload was received and verify the payload:
106121

107122
```

appengine/flexible/tasks/create_http_task.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def create_http_task(project,
3737
# project = 'my-project-id'
3838
# queue = 'my-appengine-queue'
3939
# location = 'us-central1'
40+
# url = 'https://<project-id>.appspot.com/example_task_handler'
4041
# payload = 'hello'
4142

4243
# Construct the fully qualified queue name.
@@ -46,7 +47,7 @@ def create_http_task(project,
4647
task = {
4748
'http_request': { # Specify the type of request.
4849
'http_method': 'POST',
49-
'url': url
50+
'url': url # The full url path that the task will be sent to.
5051
}
5152
}
5253
if payload is not None:

0 commit comments

Comments
 (0)