Josh J
Josh J

Reputation: 6893

Access Google cloud endpoints on a non-existent version label

I have two apps, my_app and my_endpoint_app. I can access my_endpoint_app with any version label in the URL I want and it will automatically route to the default version if it does not match an existing version.

Example:

https://josh-dot-my_endpoint_app.appspot.com/ will respond with the default version since there is no josh version deployed.

If I try to do the same with a Google Cloud Endpoint service call, I get a Not Found error.

Example:

The unsuccessful https://josh-dot-my_endpoint_app.appspot.com/_ah/api/myendpoint vs the working https://my_endpoint_app.appspot.com/_ah/api/myendpoint

I have a couple of Google AppEngine applications that communicate with each other via Cloud Endpoints.

Under normal usage this is OK because I know the version beforehand and avoid these errors. In our development environment, this falls apart. In order to support feature branches and testing in isolation, we push our code up to appspot using the -V switch of appcfg.py.

Example: appcfg.py -A my_app -V josh update .

Now I can access my feature branch at https://josh-dot-my_app.appspot.com. In order to support some version label hackery, I dynamically calculate the right endpoint app to call with something like s/my_app/my_endpont_app/g and then make my service calls there. This fails because of the dynamic version label not existing. If I push a version label with that name it completes as expected.

Is there any way to get Cloud Endpoints to answer on non-existent version label hostnames?

Scenarios that I want to support

Upvotes: 1

Views: 179

Answers (1)

Peter Knego
Peter Knego

Reputation: 80340

You can reroute any Url to any module/version via the dispatch file.

Upvotes: 1

Related Questions