cloudflare / cloudflare/cloudflare-python

Pagination on zero_trust.devices.list only returns 1 page

未关闭
#2,576 9 条评论 0 个 reaction 已指派 1 人 已被 @vaishakdinesh 认领 在 GitHub 查看
主要语言
Python
星标
506
派生
148
平均合并
3 小时 15 分钟
30 天内合并 PR
1

描述

### Confirm this is a Python library issue and not an underlying Cloudflare API issue.

- [x] 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

1. Try fetch all devices, either by automatic pagination or manual.
2. Append to list
3. Check length of list to find it's too short.

### Code snippets

```Python
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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。