【发布时间】:2018-01-24 12:49:33
【问题描述】:
使用 Google App Engine Python API 是否可以访问当前正在运行的服务的名称 - 即,在您的 app.yaml 文件中指定的服务名称与 service: foobar?
模块google.appengine.api.app_identity 提供获取应用程序ID、默认版本主机名和服务帐户名称的功能,但没有获取服务名称的功能。
我在这里查看了模块的概述 App Identity Python API Overview 和这里的 API 参考 google.appengine.api.app_identity.app_identity module
我需要服务名称来构建当前服务的完整 URL:http://service-name.application-id.appspot.com/some/url/path/
对get_default_version_hostname 的调用仅返回application-id.appspot.com 而没有服务名称组件。
【问题讨论】: