Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-453

Provide abstraction for data retrieval for the paginated APIs

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Core

    Description

      Currently, we don't have a standard abstraction for data retrieval in the paginated APIs. This means each driver needs to implement it separately which results in a lot of duplicated code.

      There are multiple ways we can solve this problem. One of them is to add a "PaginationMixin" class which can be reused across the APIs and provides base functionality similar to the existing "_get_more" and "_get_data" methods. Person implementing the driver would obviously still need to provide some information such as transformation function, how to get the last key and how to check if the result set has been exhausted

      Here is an example of how this is currently solved in the Zerigo DNS driver - https://github.com/apache/libcloud/blob/trunk/libcloud/dns/drivers/zerigo.py#L438

      Attachments

        Activity

          People

            Unassigned Unassigned
            kami Tomaz Muraus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: