如何解决无法在search_all_resourcesGCP python-asset中使用page_token
我正在尝试迭代search_all_resources寻呼机并得到以下异常。
from google.cloud import asset_v1
client = asset_v1.AssetServiceClient()
next_page_token = 0
while next_page_token is not None:
params = {
"scope": parent
}
if next_page_token != 0 and next_page_token is not None:
params['page_token'] = next_page_token
response = client.search_all_resources(**params)
assets = list(response)
total_assets.append(assets)
next_page_token = response.next_page_token
环境详细信息
- Python版本:3.8
- google-cloud-asset:2.0.0(https://github.com/googleapis/python-asset)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。