Skip to content

[ISSUE] all list operations in aim.py overwrite any set "startIndex" and therefore making pagination not useable #1123

@HansjoergW

Description

@HansjoergW

Description
all "list()" operations, like for AccountsGroupV2API have parameters "count" and "start_index" which can be set and should provide the possibility to paginate when loading the objects.

However, the "startIndex" element in the query dictionary is always being overwritten with 1, so pagination cannot work:

        query = {}
        if attributes is not None:
            query["attributes"] = attributes
        if count is not None:
            query["count"] = count
        if excluded_attributes is not None:
            query["excludedAttributes"] = excluded_attributes
        if filter is not None:
            query["filter"] = filter
        if sort_by is not None:
            query["sortBy"] = sort_by
        if sort_order is not None:
            query["sortOrder"] = sort_order.value
        if start_index is not None:
            query["startIndex"] = start_index
        headers = {
            "Accept": "application/json",
        }

        query["startIndex"] = 1
        if "count" not in query:
            query["count"] = 10000

but it should be

        if "startIndex" not in query:
            query["startIndex"] = 1

This is the case for all 12 list implementations

Reproduction
Just look at the code or try to use pagination with one of the "list" implementations in iam.py.

Expected behavior
pagination should work. startIndex should not be overwritten if it is set as method parameter.

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