]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw/admin: Add max-entries and marker to bucket list
authorTobias Urdin <tobias.urdin@binero.com>
Fri, 11 Apr 2025 08:13:57 +0000 (10:13 +0200)
committerTobias Urdin <tobias.urdin@binero.com>
Mon, 5 May 2025 15:12:20 +0000 (17:12 +0200)
commit1d5523ec0bec916e0a87fdcb8d27b67753e477b6
tree8029986321ae8d525e8e0713f73cdd7a2f9a41b7
parent5307f7abde8d8596862ac91f75d748916fec23c2
rgw/admin: Add max-entries and marker to bucket list

This adds pagination to the /admin/bucket endpoint for the
Admin API.

If a user has a lot of buckets the /admin/bucket endpoint
that is listing buckets can be so long that the HTTP request
gets a timeout.

This adds the ``max-entries`` and ``marker`` query parameters
to the API to support pagination. If ``max-entries`` is given
we introduce a new format for the HTTP response body the same
way that metadata API does, if it's not given we return the
response with the same body as before and thus retaining the
backward compatibility of the API.

This adds a Python3 based test suite that tests all of this
functionality to verify the behaviour and the HTTP response
body itself.

This fixes the pagination mentioned in tracker [1] and thus
fixes (or atleast partially fixes) that.

[1] https://tracker.ceph.com/issues/22168

Fixes: https://tracker.ceph.com/issues/22168
Signed-off-by: Tobias Urdin <tobias.urdin@binero.com>
src/rgw/driver/rados/rgw_bucket.cc
src/rgw/driver/rados/rgw_bucket.h
src/rgw/driver/rados/rgw_rest_bucket.cc
src/test/rgw/test_rgw_admin_bucket.py [new file with mode: 0644]