@@ -485,6 +485,12 @@ def find_generic_resources(setup: object, url: str, headers: dict = dict(), embe
485485 )
486486 response .raise_for_status ()
487487 resource_page = response .json ()
488+
489+ # Handle non-paginated endpoints that return direct lists
490+ if isinstance (resource_page , list ):
491+ yield resource_page
492+ return
493+
488494 if isinstance (resource_page , dict ) and resource_page .get ('page' ):
489495 try :
490496 total_pages = resource_page ['page' ]['totalPages' ]
@@ -515,8 +521,6 @@ def find_generic_resources(setup: object, url: str, headers: dict = dict(), embe
515521 # then yield subsequent pages, if applicable
516522 if get_all_pages and total_pages > 1 : # get_all_pages is False if param 'page' or 'size' to stop recursion and get a single page
517523 next_range_lower , next_range_upper = params ['page' ] + 1 , total_pages
518- if resource_type .name == 'network-groups' :
519- next_range_upper += 1 # network-groups pages are 1-based and so +1 upper limit
520524 for next_page in range (next_range_lower , next_range_upper ):
521525 params ['page' ] = next_page
522526 try :
@@ -902,7 +906,7 @@ def decorated(ref):
902906RETRY_STRATEGY = Retry (
903907 total = 5 ,
904908 status_forcelist = [403 , 404 , 413 , 429 , 503 ], # The API responds 403 and 404 for not-yet-existing executions for some async operations
905- method_whitelist = ["HEAD" , "GET" , "PUT" , "DELETE" , "OPTIONS" , "TRACE" ],
909+ allowed_methods = ["HEAD" , "GET" , "PUT" , "DELETE" , "OPTIONS" , "TRACE" ],
906910 backoff_factor = 1
907911)
908912DEFAULT_TIMEOUT = 31 # seconds, Gateway Service waits 30s before responding with an error code e.g. 503 and
0 commit comments