Pagination on zero_trust.devices.list only returns 1 page
@vaishakdinesh 已经在做这个了。
开始于 2025年6月30日。
评估
这个 Issue 还没有评估数据。
描述
Confirm this is a Python library issue and not an underlying Cloudflare API issue.
- This is an issue with the Python library
Describe the bug
When using either the automatic pagination or the "has_next_page" manual pagination on the client.zero_trust.devices.list( endpoint, only 1 page is returned (20 devices).
The "has_next_page" function returns False.
This applies to async and non-async calls.
I can confirm that I have much more than 20 devices on the account, and the old API used to fetch them all.
This has been present in the lib for a while (months). I tried this lib out a while ago and found a few issues, but didn't get to reporting them then. I thought I'd mention that in case it helps narrow the issue down.
To Reproduce
- Try fetch all devices, either by automatic pagination or manual.
- Append to list
- Check length of list to find it's too short.
Code snippets
from cloudflare import Cloudflare
client = Cloudflare()
all_devices = []
for device in client.zero_trust.devices.list(account_id=***):
all_devices.append(device)
len(all_devices)
# In my case, outputs 20 instead of 91
OS
Ubuntu 24.04
Python version
3.12.3
Library version
v4.1.0
- 主要语言
- Python
- 星标
- 512
- 派生
- 155
- 平均合并
- 2 小时 2 分钟
- 30 天内合并 PR
- 2
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudflare/cloudflare-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
cloudflare/cloudflare-python#2747 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
cloudflare/cloudflare-python#2718 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
cloudflare/cloudflare-python#2692 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
cloudflare/cloudflare-python#2679 · 4 条评论 · 5 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
cloudflare/cloudflare-python#2745 · 2 条评论 ·
查看 cloudflare/cloudflare-python 的全部 Issue
相似的 Issue
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
难度 1/5 1 小时以内 新手友好度 88/100
NousResearch/hermes-agent#132042 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
deepset-ai/haystack#13092 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
EverMind-AI/Raven#845 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
AstrBotDevs/AstrBot#10340 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
BasedHardware/omi#20401 · 1 条评论 ·
维护者通常 1 天内回复