Required Files and Configuration
Your project must contain, at a minimum, the following files:File and Location | Description |
---|---|
/src/<your_api_class>.py
|
The class file (or files, if you implement your API across multiple classes) containing your backend API. |
/src/<your_api_server>.py
|
Optional file containing your API server code, if you don't include it inside your API class. |
/src/app.yaml
|
The web app deployment descriptor required for App Engine configuration. |
The contents of each of these required files is documented in the following sections.
The backend API class file
The required and optional contents of the class file (or files, if you use a multi-class API ) are fully described in the topic Creating an Endpoints API .
The API server file (Optional)
This file and its contents are fully described under Creating an API server .
app.yaml
The bare minimum contents required for this file are as follows:
application: your-app-id
version: version_number
runtime: python27
threadsafe: true
api_version: 1
handlers:
# Endpoints handler
- url: /_ah/spi/.*
script: helloworld_api.APPLICATION
libraries:
- name: pycrypto
version: latest
- name: endpoints
version: 1.0
where:
-
your-app-id
is replaced with the actual App Engine application ID for your backend API -
version_number
is replaced by the App Engine version number you want to use, with the first version of your app starting at version1
. (For a full discussion of App Engine versions, see Deploying to multiple app versions .) -
helloworld_api
is replaced with the name of your own backend API module. -
threadsafe
is set to true if you want App Engine to send multiple requests in parallel, or set to false, if you want App Engine to send requests serially.
Additional but optional settings are available. See Python Application Configuration with app.yaml for more information. However, note that the information under Requiring login or administrator status and Secure URLs do not apply to backend APIs.