|
|
@@ -12,6 +12,7 @@ import requests
|
|
|
import cloudbridge.cloud.base.helpers as cb_helpers
|
|
|
from cloudbridge.cloud.base.middleware import dispatch
|
|
|
from cloudbridge.cloud.base.resources import ClientPagedResultList
|
|
|
+from cloudbridge.cloud.base.resources import ServerPagedResultList
|
|
|
from cloudbridge.cloud.base.services import BaseBucketObjectService
|
|
|
from cloudbridge.cloud.base.services import BaseBucketService
|
|
|
from cloudbridge.cloud.base.services import BaseComputeService
|
|
|
@@ -1228,7 +1229,28 @@ class AWSFloatingIPService(BaseFloatingIPService):
|
|
|
priority=BaseFloatingIPService.STANDARD_EVENT_PRIORITY)
|
|
|
def list(self, gateway, limit=None, marker=None):
|
|
|
log.debug("Listing all floating IPs under gateway %s", gateway)
|
|
|
- return self.svc.list(limit=limit, marker=marker)
|
|
|
+ limit = limit or self.provider.config.default_result_limit
|
|
|
+ collection = self.boto_collection.filter()
|
|
|
+ pag_type, resume_token, boto_objs = self.svc._make_query(collection,
|
|
|
+ limit,
|
|
|
+ marker)
|
|
|
+ # Wrap in CB objects.
|
|
|
+ results = [AWSFloatingIP(self.provider, gateway, obj) for obj in
|
|
|
+ boto_objs]
|
|
|
+
|
|
|
+ if pag_type == 'server':
|
|
|
+ log.debug("Using server pagination.")
|
|
|
+ return ServerPagedResultList(is_truncated=True if resume_token
|
|
|
+ else False,
|
|
|
+ marker=resume_token if resume_token
|
|
|
+ else None,
|
|
|
+ supports_total=False,
|
|
|
+ data=results)
|
|
|
+ else:
|
|
|
+ log.debug("Did not received a resume token, will page in client"
|
|
|
+ " if necessary.")
|
|
|
+ return ClientPagedResultList(self.provider, results,
|
|
|
+ limit=limit, marker=marker)
|
|
|
|
|
|
@dispatch(event="provider.networking.floating_ips.create",
|
|
|
priority=BaseFloatingIPService.STANDARD_EVENT_PRIORITY)
|