
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Deploy an app engine application
/ 50
Create and deploy a new version of your app
/ 50
Google APIs Explorer is a tool that lets you try out various Google APIs interactively. With the APIs Explorer, you can:
App Engine lets you deploy applications on a fully managed platform. You can scale your applications seamlessly without having to worry about managing the underlying infrastructure. With zero server management and zero configuration deployments, developers can focus only on building great applications without the management overhead.
In this lab you will deploy a simple hello world application to App Engine and make updates to its configuration using the App Engine Admin API through the APIs Explorer tool.
In this lab, you will:
This is a fundamental level lab. You should be familiar with the basic functioning and architecture of APIs. Experience with Google Cloud Shell and command-line interface tools is recommended.
Familiarity with the APIs Explorer tool is also recommended. At a minimum, take the following labs before attempting this one:
If you are unfamiliar with App Engine, the App Engine: Qwik Start - Python lab has valuable information that will orient you with the content of this lab. Once you're ready, scroll down and follow the steps below to set up your lab environment.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud
, in Google Cloud, refer to the gcloud CLI overview guide.
You will now build an App Engine application with one of the methods found in the APIs Explorer.
To access the App Engine APIs Explorer tool, open up the Navigation menu () and select APIs & Services > Library.
In the search bar, enter in App Engine and select the App Engine Admin API from the results list. Make sure that API is enabled, if not click Enable.
Now that you have verified the API's enablement, open the Method: apps.create reference. This will take you to the apps create method.
Under Try this method in the right panel, click in the Request body field and add:
Click the EXECUTE button.
Select the student account you started the lab with.
On the next screen, click Allow to give APIs Explorer access.
Your response should resemble the following:
You have successfully built an App Engine application for a Google Cloud project.
Next you'll retrieve some information on your App Engine application to ensure that it has been properly created.
From the left All APIs & Reference section navigate to REST API > v1 > apps > get. Or you can use this direct link to apps.get
method.
For the appsId field, enter your <PROJECT_ID>
found in the Connection Details section of the lab.
Make sure that Google OAuth 2.0 and API key checkboxes are selected under Credentials section.
Your response should resemble the following:
This method works as a sanity check and offers you useful information about your App Engine application, such as its default hostname, location, and serving status.
Before you deploy an App Engine application, you will need to download some starter code so you have something to work with.
The hello_world
folder contains a simple Python application that uses the Flask web framework. This Python app responds to a request with an HTTP header and the message "Hello World!"
[YOUR_PROJECT_ID]
with your Project ID:The deployment will take a couple minutes to complete. Once it has finished, you should receive a similar output:
https://qwiklabs-gcp-b5d5fa242d334941.appspot.com
and paste it in a new tab. This will open the hello world application. Your page should resemble the following:Now that your application is deployed, you will make some changes to your App Engine configuration with the APIs Explorer.
Keep the Hello World! page open.
Click Check my progress to verify your performed task. If you have successfully deployed an app engine application, you will see an assessment score.
You will now create, list, and delete firewall rules that prescribe access to your hello world application.
From the APIs & Reference section navigate to REST API > v1 > apps.firewall.ingressRules > create . Or, you can use this direct link to apps.firewall.ingressRules.create
method.
For the appsId field, enter your Project ID.
Now click on the Request body and add:
*
.Your method should resemble the following:
This firewall rule rejects all requests to your hello world application.
To see it in action, Refresh your hello world page in your browser. You should now see that access is now forbidden:
Return to the APIs Explorer page for the next step.
From the left All APIs & Reference section navigate to REST API > v1 > apps.firewall.ingressRules > list Or you can use this direct link to apps.firewall.ingressRules.list
method.
For the appsId field, enter your Project ID.
Your response should resemble the following:
You now see the two firewall rules: one that allows traffic and another that denies traffic to your application. Note the priority values for each ingress rule — these act as firewall rule IDs as well.
From the left All APIs & Reference section navigate to REST API > v1 > apps.firewall.ingressRules > delete Or you can use this direct link to apps.firewall.ingressRules.delete
method.
For the appsId field, enter your Project ID. For the ingressRulesId field, enter 1. Your method should resemble the following:
Your response should resemble the following:
Now that you've gotten practice with ingress firewall rule configuration, take it to the next level by creating and deploying new versions of our application.
Now make a small change to your application's source code.
hello_world
directory. If not, run the following command:main.py
file with the nano
text editor:nano
editor.You will now create a new version of your application that uses your updated "Goodbye world!" codebase.
Copy the staging.qwiklabs-gcp-xxxx.appspot.com
bucket name and save it.
Now click on that bucket to view the files it contains.
Copy the name of the application/json
file and save it.
You now have the information needed to create a new version of your hello world application.
Return to the APIs Explorer for the next step.
From the left All APIs & Reference section navigate to REST API > v1 > apps.services.versions > create. Or you can use this direct link to apps.services.versions.create
method.
For the appsId field, enter your Project ID. For the servicesId field, enter default.
Now click in the request body and add:
Your method should now resemble the following:
<YOUR_BUCKET_NAME>
with the name of the staging Cloud Storage bucket and <YOUR_JSON_FILE_NAME>
with the name of the JSON file you copied over:Your method should now resemble the following:
You should receive the following output:
There were many fields to fill out, but that is where the APIs Explorer shines. Being able to visualize all the parameters and see how they relate to one another is critical in successfully calling API methods.
Return to the Cloud Console for this step.
Open the Navigation menu (), click View all Products and from the Serverless section, select App Engine > Versions.
You should see that there are now two versions of your application available:
hello_world
directory. If not, run the following command:You will now deploy the new version of your application.
The deployment will take a couple minutes to complete.
Once it has finished, you should receive a similar output:
If you return to the Cloud Console and look at App Engine > Versions you will see that that v1
is being run:
You have successfully created a new version of an application with the APIs Explorer and deployed it in Cloud Shell.
Click Check my progress to verify your performed task. If you have successfully created a new version of your app, you will see an assessment score.
In this lab, you got hands-on practice with App Engine Admin API methods using the APIs Explorer. After building an App Engine application with the APIs Explorer tool, you deployed an instance from the hello world sample code. You then learned how to configure ingress firewall rules with the APIs Explorer tool. After making changes to the codebase, you used the APIs Explorer to create a new version of your application, which you deployed and successfully accessed. You are now ready to take more Exploring APIs labs.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated November 05, 2024
Lab Last Tested November 05, 2024
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.