@@ -34,66 +34,66 @@ To set up authentication, please refer to our
3434
3535To install the dependencies for this sample, use the following command:
3636
37- ```
37+ ``` sh
3838pip install -r requirements.txt
3939```
4040
4141This sample uses the common protos in the [ googleapis] ( https://github.com/googleapis/googleapis )
4242repository. For more info, see
4343[ Protocol Buffer Basics] ( https://developers.google.com/protocol-buffers/docs/pythontutorial ) .
4444
45- ## Creating a queue
46-
47- To create a queue using the Cloud SDK, use the following gcloud command:
48-
49- ```
50- gcloud tasks queues create my-appengine-queue
51- ```
52-
53- Note: A newly created queue will route to the default App Engine service and
54- version unless configured to do otherwise.
55-
5645## Deploying the App Engine App
5746
5847Deploy the App Engine app with gcloud:
5948
6049* To deploy to the Standard environment:
61- ```
50+ ``` sh
6251 gcloud app deploy app.yaml
6352 ```
6453* To deploy to the Flexible environment:
65- ```
54+ ``` sh
6655 gcloud app deploy app.flexible.yaml
6756 ```
6857
6958Verify the index page is serving:
7059
71- ```
60+ ``` sh
7261gcloud app browse
7362```
7463
7564The App Engine app serves as a target for the push requests. It has an
7665endpoint ` /example_task_handler ` that reads the payload (i.e., the request body)
7766of the HTTP POST request and logs it. The log output can be viewed with:
7867
79- ```
68+ ``` sh
8069gcloud app logs read
8170```
8271
72+ ## Creating a queue
73+
74+ To create a queue using the Cloud SDK, use the following gcloud command:
75+
76+ ``` sh
77+ gcloud tasks queues create my-appengine-queue
78+ ```
79+
80+ Note: A newly created queue will route to the default App Engine service and
81+ version unless configured to do otherwise.
82+
8383## Run the Sample Using the Command Line
8484
8585Set environment variables:
8686
8787First, your project ID:
8888
89- ```
89+ ``` sh
9090export PROJECT_ID=my-project-id
9191```
9292
9393Then the queue ID, as specified at queue creation time. Queue IDs already
9494created can be listed with ` gcloud tasks queues list ` .
9595
96- ```
96+ ``` sh
9797export QUEUE_ID=my-appengine-queue
9898```
9999
@@ -103,13 +103,20 @@ the "name" value (for instance, if the name is
103103"projects/my-project/locations/us-central1/queues/my-appengine-queue", then the
104104location is "us-central1").
105105
106- ```
106+ ``` sh
107107export LOCATION_ID=us-central1
108108```
109+
109110### Using App Engine Queues
111+
110112Running the sample will create a task, targeted at the ` /example_task_handler `
111113endpoint, with a payload specified:
112114
113- ```
115+ > ** Note**
116+ > Please update
117+ > [ create_app_engine_queue_task.py] ( ./create_app_engine_queue_task.py ) before running the following
118+ > command.
119+
120+ ``` sh
114121python create_app_engine_queue_task.py --project=$PROJECT_ID --queue=$QUEUE_ID --location=$LOCATION_ID --payload=hello
115122```
0 commit comments