Versioning with endpoint V2 on GAE

杀马特。学长 韩版系。学妹 提交于 2019-12-03 04:01:19

While not really an answer, I saw this:

When deploying a legacy type endpoint (V1), everything works fine, https://3-dot-xx.appspot.com/_ah/api/discovery/v1/apis will show the APIs deployed to version 3

When deploying a new type endpoint (v2), eg 2-dot-, it depends on the last V1 endpoint deployed on the version.

  • if it is a new version with no V1 endpoint deployed before, it works and the new endpoint is shown on 2-dot-
  • if there was a V1 endpoint deployed here before, it will show the old V1 apis and naturally generate a 404 when accessing, as the actually running GAE version is different
  • if the version was never deployed at all (eg asdf-dot-), or using the default (without the -dot- etc), it will show the default version and access it correctly.
  • if there never was a V1 service deployed, but a V2 service, it works fine when deploying a new V2 service

So, it seems like there is a bug that will prevent you from using stable names for testing / staging environments if you already had a V1 service running on them. It would be very helpful if someone from Google could confirm this bug and suggest an appropriate workaround before I have to do a lot of costly changes to change URLs.

The short answer for me was: do not reuse version names that were previously used with endpointV1.

E.g. I had a testing-dot-MYPROJECT.appspot.com.

I now use a different version: test-dot-MYPROJECT.appspot.com.

For the long answer, have a look at cputoaster's answer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!