You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Tomaz Muraus (JIRA)" <ji...@apache.org> on 2013/12/05 16:16:35 UTC

[jira] [Created] (LIBCLOUD-453) Provide abstraction for data retrieval for the paginated APIs

Tomaz Muraus created LIBCLOUD-453:
-------------------------------------

             Summary: Provide abstraction for data retrieval for the paginated APIs
                 Key: LIBCLOUD-453
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-453
             Project: Libcloud
          Issue Type: Task
          Components: Core
            Reporter: Tomaz Muraus
            Priority: Minor


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



--
This message was sent by Atlassian JIRA
(v6.1#6144)