libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [libcloud] Kami opened a new pull request #1409: [WIP] Fix pagination in the "list_nodes()" method in the GCE driver
Date Tue, 14 Jan 2020 06:27:26 GMT
Kami opened a new pull request #1409: [WIP] Fix pagination in the "list_nodes()" method in
the GCE driver
URL: https://github.com/apache/libcloud/pull/1409
 
 
   This pull request is an attempt to try to fix an issue reported in #515.
   
   ### Background / Problem Description
   
   Currently ``list_nodes()`` method only returns up to 500 nodes (which is a page size value
we use with our list requests and also a max page size limit set by Google).
   
   This is true either when we are requesting nodes for all the zones (aggregated request)
or when requesting nodes for a single zone.
   
   ### Proposed Fix
   
   This pull request fixes that by utilizing ``request_aggregated_items`` method in both scenarios
(when we are requesting nodes in all the zones and also when requesting nodes for a single
zone).
   
   I tested the change by setting ``maxResults`` in the ``request_aggregated_items`` method
to ``1`` and verified that all the pages are correctly retrieved since I don't have an account
with more than 500 instances to test it out.
   
   ---
   
   On a somewhat related note -  unless I'm missing something, it appears the same issue may
also exist with other "list" API endpoints when retrieving items for a specific zone and that
response contains more then max page size number of items (since we don't follow through pagination
when requesting items for a single zone).
   
   As you can see in the diff, this change also allowed me to simplify ``list_nodes()`` method.
If my assertion / observation above is correct, this would mean we can also simplify other
list methods.
   
   @erjohnso Please correct me if I'm wrong or missing something.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message