Open farisdurrani opened 2 weeks ago
Here a workaround to fix it: This is part of a class, without class remove the self.
##########################################################################
# Pagination main call
##########################################################################
def __list_call_get_all_results(self, list_func_ref, *list_func_args, **list_func_kwargs):
aggregated_results = []
for call_result in self.__list_call_get_all_results_generator_domains(list_func_ref, *list_func_args, **list_func_kwargs):
aggregated_results.extend(call_result.data.resources)
final_response = oci.Response(call_result.status, call_result.headers, aggregated_results, call_result.request)
return final_response
##########################################################################
# Pagination result generator
##########################################################################
def __list_call_get_all_results_generator_domains(self, list_func_ref, *list_func_args, **list_func_kwargs):
keep_paginating = True
while keep_paginating:
call_result = oci.retry.DEFAULT_RETRY_STRATEGY.make_retrying_call(list_func_ref, *list_func_args, **list_func_kwargs)
yield call_result
start_index = call_result.data.start_index
total_results = call_result.data.total_results
items_per_page = call_result.data.items_per_page
next_index = start_index + items_per_page
# print("\nCalled " + str(list_func_ref))
# print("start_index: " + str(start_index) + ", " + "total_results: " + str(total_results) + ", " + "items_per_page: " + str(items_per_page) + ", " + "next_index: " + str(next_index))
if next_index < total_results:
list_func_kwargs['start_index'] = next_index
else:
keep_paginating = False
The below code attempts to list all groups in an identity domain. However, adding either
attribute_sets
orattributes
will cause the response to indicatehas_next_page == True
andnext_page
to have a value even if the results are already complete.Versions