如何解决无法从GCE调用Discovery.build'compute','v1',凭据=凭据
在运行构建命令时,它会超时。
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
service = discovery.build('compute','v1',credentials=credentials)
只有在正确设置环境的情况下,我才能在计算引擎上运行它。这是较早的工作。
我可以运行service = discovery.build('storage',credentials=credentials)
错误我现在得到
Traceback (most recent call last):
File "<stdin>",line 1,in <module>
File "/usr/local/lib/python2.7/dist-packages/googleapiclient/_helpers.py",line 134,in positional_wrapper
return wrapped(*args,**kwargs)
File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py",line 250,in build
developerKey,num_retries=num_retries
File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py",line 316,in _retrieve_discovery_doc
resp,content = req.execute(num_retries=num_retries)
File "/usr/local/lib/python2.7/dist-packages/googleapiclient/_helpers.py",**kwargs)
File "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py",line 901,in execute
headers=self.headers,File "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py",line 204,in _retry_request
raise exception
ssl.SSLError: ('The read operation timed out',)
计算引擎API是否存在问题? 任何线索都会有所帮助。
解决方法
这是一个已知的临时问题。来自https://status.cloud.google.com/
Google的API发现服务GetRest(https://www.googleapis.com/discovery/v1/apis/pubsub/v1/rest)请求正在以下区域中挂起:asia-northeast1,asia-northeast2,asia-northeast3,asia-southeast1,europe-west1,europe-west3,europe-west6 ,欧洲西部4,北美洲东北1,南欧东南1,美国中央1,美国东部1,美国西部1,美国西部2和美国西部4。
我们目前正在努力通过回滚配置更改来缓解这种情况。下次更新时间是美国/太平洋地区,2020年10月4日星期四。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。