Skip to content

Total Items #638

@sudorandom

Description

@sudorandom

When making API calls which has a listing of items, the API will return the total number of items in a header named 'SoftLayer-Total-Items'. This should be made available in the return value.

I propose wrapping API results that are lists with a class that looks like this:

class SoftLayerListResult(list):
    def __init__(self, items, total_count):
        self.total_count = total_count
        super(SoftLayerListResult, self).__init__(items)

This should maintain backwards compatibility while exposing the total count of items to consumers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions