本文整理汇总了Python中oauth2client.gce.AppAssertionCredentials方法的典型用法代码示例。如果您正苦于以下问题:Python gce.AppAssertionCredentials方法的具体用法?Python gce.AppAssertionCredentials怎么用?Python gce.AppAssertionCredentials使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oauth2client.gce
的用法示例。
在下文中一共展示了gce.AppAssertionCredentials方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _implicit_credentials_from_gae
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _implicit_credentials_from_gae():
"""Attempts to get implicit credentials in Google App Engine env.
If the current environment is not detected as App Engine, returns None,
indicating no Google App Engine credentials can be detected from the
current environment.
Returns:
None, if not in GAE, else an appengine.AppAssertionCredentials object.
"""
if not _in_gae_environment():
return None
return _get_application_default_credential_GAE()
示例2: _implicit_credentials_from_gce
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _implicit_credentials_from_gce():
"""Attempts to get implicit credentials in Google Compute Engine env.
If the current environment is not detected as Compute Engine, returns None,
indicating no Google Compute Engine credentials can be detected from the
current environment.
Returns:
None, if not in GCE, else a gce.AppAssertionCredentials object.
"""
if not _in_gce_environment():
return None
return _get_application_default_credential_GCE()
示例3: _get_application_default_credential_GAE
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _get_application_default_credential_GAE():
from oauth2client.appengine import AppAssertionCredentials
return AppAssertionCredentials([])
示例4: _get_application_default_credential_GCE
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _get_application_default_credential_GCE():
from oauth2client.gce import AppAssertionCredentials
return AppAssertionCredentials([])
示例5: _implicit_credentials_from_gae
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _implicit_credentials_from_gae():
"""Attempts to get implicit credentials in Google App Engine env.
If the current environment is not detected as App Engine, returns None,
indicating no Google App Engine credentials can be detected from the
current environment.
Returns:
None, if not in GAE, else an appengine.AppAssertionCredentials
object.
"""
if not _in_gae_environment():
return None
return _get_application_default_credential_GAE()
示例6: _implicit_credentials_from_gce
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _implicit_credentials_from_gce():
"""Attempts to get implicit credentials in Google Compute Engine env.
If the current environment is not detected as Compute Engine, returns
None, indicating no Google Compute Engine credentials can be detected
from the current environment.
Returns:
None, if not in GCE, else a gce.AppAssertionCredentials object.
"""
if not _in_gce_environment():
return None
return _get_application_default_credential_GCE()
示例7: _get_application_default_credential_GAE
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _get_application_default_credential_GAE():
from oauth2client.appengine import AppAssertionCredentials
return AppAssertionCredentials([])
示例8: _get_application_default_credential_GCE
# 需要导入模块: from oauth2client import gce [as 别名]
# 或者: from oauth2client.gce import AppAssertionCredentials [as 别名]
def _get_application_default_credential_GCE():
from oauth2client.gce import AppAssertionCredentials
return AppAssertionCredentials([])