如何使用ConfluenceAPI"get_all_pages_from_space"?

How to use the Confluence API "get_all_pages_from_space"?

我正在尝试使用 Confluence API“get_all_pages_from_space”来检索 Confluence space 中的所有页面(总共 400 个左右)。

# Get all pages from Space
# content_type can be 'page' or 'blogpost'. Defaults to 'page'
# expand is a comma separated list of properties to expand on the content.
# max limit is 100. For more you have to loop over start values.
confluence.get_all_pages_from_space(space, start=0, limit=100, status=None, expand=None, content_type='page')

这个API(here)的文档说

max limit is 100. For more you have to loop over start values.

我不知道在我的 Python 代码中 循环起始值 是什么意思。我用这个 API 检索了 space 下的所有页面,但它只 returns 前 50 页左右。

有人用过这个API吗?请让我知道如何遍历起始值。谢谢!

有点晚了,但希望仍然能有所帮助:

def get_all_pages(confluence, space):
start = 0
limit = 100
_all_pages = []
while True:
    pages = confluence.get_all_pages_from_space(space, start, limit, status=None, expand=None, content_type='page')
    _all_pages = _all_pages + pages
    if len(pages) < limit:
        break
    start = start + limit
return _all_pages