Reputation: 2458
I am new with Google App Engine and I currently have a functioning Endpoint that I am able to deploy in Android Studio using the Build > Deploy Module to App Engine...
menu Item.
When deploying I notice that Android Studio uses the version number from appengine-web.xml
and it's that version number that gets used in the console once deployed. I am wondering, what does the API version number mean and should it match Endpoint version?
For example my endpoint class is configured as such (v2):
@Api(
name = "myApi",
version = "v2",
namespace = @ApiNamespace(
ownerDomain = "backend.mydomain",
ownerName = "backend.mydomain",
packagePath = ""
)
)
But my if my appengine-web.xml
is configured for version 1 the backend code gets pushed to version 1 yet continues to function with API version 2.
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>myproject</application>
<version>1</version>
<threadsafe>true</threadsafe>
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
</system-properties>
</appengine-web-app>
Is this a problem or bad practice?
Upvotes: 0
Views: 113
Reputation: 6893
This is OK. The versions in App Engine correspond with a deployed version of code that runs on an instance. You can have multiple app engine versions but they are each their own distinct deployment. Versions in Cloud Endpoints are considered api versions and you can have one or more running inside of the same app engine version.
A good way to think of App Engine versions would be your traditional Dev, Staging, Production paradigm. You can deploy <version>dev</version>
, <version>stage</version>
, and <version>prod</version>
then set prod
as your default serving version. Each of those App Engine versions could then host api versions v1
, v2
, and v3
.
Upvotes: 1