【发布时间】:2022-07-18 23:53:46
【问题描述】:
我正在使用 Google earthengine 来运行 GIS 计算。最近谷歌添加了项目来管理创建的资产,这意味着我需要使用谷歌云 API 来找回我的项目名称。
我使用服务帐户连接到 API,但我无法访问我的项目列表。不过,我确定我已将“https://www.googleapis.com/auth/cloudplatformprojects.readonly”范围添加到我的帐户中。
有没有办法让我使用 API 检查我当前范围的列表?
import ee
ee.Iniitialize()
# that's the credential I would like to test
# it's a ServiceAccountCredential like any other Google API (I use it to connect to drive as well)
cred = ee.Credentials()
# something like
for scope in cred.scopes():
print(scope)
【问题讨论】:
-
您要连接到哪个 api,我可以获得您正在关注的文档链接吗?
-
我正在尝试完成以下工作流程:stackoverflow.com/questions/58366396/…,但由于范围问题而被系统拒绝
标签: python google-api google-authentication