Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcs client pagination #738

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

* Fix pagination on iterable gcs client routes (:pr:`NUMBER`)
22 changes: 22 additions & 0 deletions src/globus_sdk/services/gcs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ def get_storage_gateway_list(
self,
*,
include: None | str | t.Iterable[str] = None,
page_size: int | None = None,
marker: str | None = None,
query_params: dict[str, t.Any] | None = None,
) -> IterableGCSResponse:
"""
Expand All @@ -308,6 +310,11 @@ def get_storage_gateway_list(
policies in the attached storage_gateways document. This requires an
``administrator`` role on the Endpoint.
:type include: str or iterable of str, optional
:param page_size: Number of results to return per page
:type page_size: int, optional
:param marker: Pagination marker supplied by previous API calls in the event
a request returns more values than the page size
:type marker: str, optional
:param query_params: Additional passthrough query parameters
:type query_params: dict, optional

Expand All @@ -329,6 +336,10 @@ def get_storage_gateway_list(
query_params = {}
if include is not None:
query_params["include"] = ",".join(utils.safe_strseq_iter(include))
if page_size is not None:
query_params["page_size"] = page_size
if marker is not None:
query_params["marker"] = marker
return IterableGCSResponse(
self.get("/storage_gateways", query_params=query_params)
)
Expand Down Expand Up @@ -480,6 +491,8 @@ def get_role_list(
self,
collection_id: UUIDLike | None = None,
include: str | None = None,
page_size: int | None = None,
marker: str | None = None,
query_params: dict[str, t.Any] | None = None,
) -> IterableGCSResponse:
"""
Expand All @@ -492,6 +505,11 @@ def get_role_list(
:param include: Pass "all_roles" to request all roles all roles
relevant to the resource instead of only those the caller has on
the resource
:param page_size: Number of results to return per page
:type page_size: int, optional
:param marker: Pagination marker supplied by previous API calls in the event
a request returns more values than the page size
:type marker: str, optional
:type include: str, optional
:param query_params: Additional passthrough query parameters
:type query_params: dict, optional
Expand All @@ -510,6 +528,10 @@ def get_role_list(
query_params = {}
if include is not None:
query_params["include"] = include
if page_size is not None:
query_params["page_size"] = page_size
if marker is not None:
query_params["marker"] = marker
if collection_id is not None:
query_params["collection_id"] = collection_id

Expand Down