|
5 | 5 | [shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
|
6 | 6 | [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
|
7 | 7 |
|
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 | +. |
10 | 10 |
|
11 | 11 | App Engine queues push tasks to an App Engine HTTP target. This directory
|
12 | 12 | contains both the App Engine app to deploy, as well as the snippets to run
|
@@ -94,14 +94,29 @@ location is "us-central1").
|
94 | 94 | ```
|
95 | 95 | export LOCATION_ID=us-central1
|
96 | 96 | ```
|
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` |
99 | 99 | endpoint, with a payload specified:
|
100 | 100 |
|
101 | 101 | ```
|
102 | 102 | python create_app_engine_queue_task.py --project=$PROJECT_ID --queue=$QUEUE_ID --location=$LOCATION_ID --payload=hello
|
103 | 103 | ```
|
104 | 104 |
|
| 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 | + |
105 | 120 | Now view that the payload was received and verify the payload:
|
106 | 121 |
|
107 | 122 | ```
|
|
0 commit comments