GCP API 的默认最大页面大小记录在哪里?
Where is the default max page size of GCP APIs documented?
查看 API 参考文献,我发现没有描述最大页面大小:https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.locations.jobs/list
但这是否意味着我可以将页面设置成我想要的大小?现在我让它任意大:
from googleapiclient import discovery
discovery_service = discovery.build("dataflow", "v1b3", cache_discovery=False)
jobs = discovery_service.projects().locations().jobs().list(
projectId=my_project,
location="aggregated",
pageSize=100000 # Is there any limit here?
).execute().get('jobs',[])
print(len(jobs))
我只有几千份工作,而且似乎所有的工作都得到了,但我想知道我是否可以永远摆脱这个。每当我看到像这样的 API 的分页器时,它总是对 return.
的内容有某种限制
我宁愿像上面那样不设置限制,因为它对我的需要来说要简单得多,但我不相信 google 文档。真的完全没有限制吗,这个可以确认吗?
虽然没有指定边界,但pageSize
定义如下:
integer
If there are many jobs, limit the response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit.
还有其他因素会影响返回的最大项目数:代理和负载平衡器的传输限制、单个项目的大小、网络可靠性等
可能不建议设置较大的值,而是在某些异常情况下使用默认值。这是为了避免使用新数据扩展的项目出现故障
查看 API 参考文献,我发现没有描述最大页面大小:https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.locations.jobs/list
但这是否意味着我可以将页面设置成我想要的大小?现在我让它任意大:
from googleapiclient import discovery
discovery_service = discovery.build("dataflow", "v1b3", cache_discovery=False)
jobs = discovery_service.projects().locations().jobs().list(
projectId=my_project,
location="aggregated",
pageSize=100000 # Is there any limit here?
).execute().get('jobs',[])
print(len(jobs))
我只有几千份工作,而且似乎所有的工作都得到了,但我想知道我是否可以永远摆脱这个。每当我看到像这样的 API 的分页器时,它总是对 return.
的内容有某种限制我宁愿像上面那样不设置限制,因为它对我的需要来说要简单得多,但我不相信 google 文档。真的完全没有限制吗,这个可以确认吗?
虽然没有指定边界,但pageSize
定义如下:
integer
If there are many jobs, limit the response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit.
还有其他因素会影响返回的最大项目数:代理和负载平衡器的传输限制、单个项目的大小、网络可靠性等
可能不建议设置较大的值,而是在某些异常情况下使用默认值。这是为了避免使用新数据扩展的项目出现故障