Skip to content

Pagination does not work for identity_domains_client.list_groups if attributes are added #708

Open
@farisdurrani

Description

@farisdurrani

The below code attempts to list all groups in an identity domain. However, adding either attribute_sets or attributes will cause the response to indicate has_next_page == True and next_page to have a value even if the results are already complete.

import oci

config = oci.config.from_file("~/.oci/config", "DEFAULT")
tenancy_ocid = config["tenancy"]

# Get the domain endpoint
identity_client = oci.identity.IdentityClient(config)
list_domains_response = identity_client.list_domains(tenancy_ocid)
domain01_endpoint = list_domains_response.data[0].url

# Get the groups
identity_domains_client = oci.identity_domains.IdentityDomainsClient(
    config, domain01_endpoint
)
list_groups_response = identity_domains_client.list_groups(
    # BUG: adding attribute_sets or attributes causes the `has_next_page` to be true
    attribute_sets=["request"],
    attributes="members,ocid",
)
print(list_groups_response.has_next_page)
# outputs True even if the response is already complete and no more pages are expected

Versions

  • oci==2.131.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions