我想重定向我的测试用户到我的应用程序引擎应用程序的最新版本。我听说您可以使用url latest-dot-project-id.appspot.com访问最新版本,但这只是默认版本。
任何想法如何重定向到最新版本,其中可能有url version-dot-project-id.appspot.com
我知道我可以访问API以获得最新版本,但我也很难从那里获得服务帐户的数据。
发布于 2015-07-20 16:19:40
最后使用获得最新版本。
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://appengine.googleapis.com/v1beta4/apps/-----/modules/default/versions");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = array();
$headers[] = 'Authorization: Bearer '.json_decode($client->getAccessToken())->access_token;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$versions = json_decode(curl_exec ($ch))->versions;
curl_close ($ch);
$newest_version = "0";
foreach($versions as $version){
if(str_replace("-", "", $version->id) > str_replace("-", "", $newest_version)){
$newest_version = $version->id;
}
}发布于 2015-07-21 03:49:19
您应该能够使用通用的最新关键字(而不是找出该模块的哪个特定版本是最新的)来访问您需要的任何模块:
latest-dot-<modulename>-dot-<appname>.appspot.com。
至少在蟒蛇身上有效..。
在latest-dot-project-id.appspot.com构造中,您没有指定模块名,这很可能是您只访问默认模块的原因。
通过URL文档进行路由选择中的更多细节
发布于 2015-07-20 01:03:48
AFAIK,应用程序无法编程访问可用的版本,所以要弄清楚“最新”版本需要的是一个保留的名称。test怎么样?上传要使用version: test进行测试的版本,让测试人员点击它。然后,当您想要使用测试版本时,再次以“真实”版本上传它,然后将其设置为默认版本。这第二次上传应该非常快,假设你没有改变任何东西。
FWIW,许多人在测试版本中使用完全不同的应用程序名称,这样测试人员就不会修改生产数据。
https://stackoverflow.com/questions/31506599
复制相似问题