Pagination

oci.pagination.list_call_get_all_results(list_func_ref, *list_func_args, **list_func_kwargs)

Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the no more records are available. Apart from the formally listed parameters for this function, any additional positional (*list_func_args) and keyword (**list_func_kwargs) arguments will be passed to the list operation.

Results are eagerly loaded and the response returned by this function will contain all the available data. If you wish to lazy load results, then use the version of this method which produces a generator: list_call_get_all_results_generator()

Parameters:list_func_ref (function) – A reference to the list operation which we will call
Returns:A Response whose data attribute contains all the records we retrieved. The other attributes of the Response object will be sourced from the last response we received from calling the list operation on the service.
Return type:Response
oci.pagination.list_call_get_up_to_limit(list_func_ref, record_limit, page_size, *list_func_args, **list_func_kwargs)

Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the desired number of records is reached (or there are no more records left, if the total number of records is less than the desired number of records). Apart from the formally listed parameters for this function, any additional positional (*list_func_args) and keyword (**list_func_kwargs) arguments will be passed to the list operation.

Results are eagerly loaded and the response returned by this function will contain all the data up to the desired number of records (or there are no more records left, whichever is first). If you wish to lazy load results, then use the version of this method which produces a generator: list_call_get_up_to_limit_generator()

Parameters:
  • list_func_ref (function) – A reference to the list operation which we will call
  • record_limit (int) – The maximum number of records to fetch. We may fetch less records than this if the total number of records is less than this value. If a record_limit is not provided then we will only fetch a single page of data
  • page_size (int) – The number of records to retrieve per list operation call
Returns:

A Response whose data attribute contains all the records we retrieved. The other attributes of the Response object will be sourced from the last response we received from calling the list operation on the service.

Return type:

Response

oci.pagination.list_call_get_all_results_generator(list_func_ref, yield_mode, *list_func_args, **list_func_kwargs)

Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the no more records are available. Apart from the formally listed parameters for this function, any additional positional (*list_func_args) and keyword (**list_func_kwargs) arguments will be passed to the list operation.

This function produces a generator and lazily loads results. That is, service calls will only be made to fetch more data when needed as we iterate through results produced by the generator; this contrasts with the eagarily loaded list_call_get_all_results() function, which makes all the required service calls when it is called.

The generator also supports vending two types of objects - either the raw responses received from calling the list operation, or the individual model objects which are contained within the response’s data attribute (which should be a list of model objects).

Parameters:
  • list_func_ref (function) – A reference to the list operation which we will call
  • yield_mode (str) – Either response or record. This will control whether the generator returned by this function yields either Response objects (if the value is response), or whether it yields the individual model objects which are contained within the response’s data attribute (which should be a list of model objects)
Returns:

A generator that, depending on the yield_mode, will yield either Response objects or the individual model objects which are contained within the response’s data attribute (which should be a list of model objects)

oci.pagination.list_call_get_up_to_limit_generator(list_func_ref, record_limit, page_size, yield_mode, *list_func_args, **list_func_kwargs)

Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the desired number of records is reached (or there are no more records left, if the total number of records is less than the desired number of records). Apart from the formally listed parameters for this function, any additional positional (*list_func_args) and keyword (**list_func_kwargs) arguments will be passed to the list operation.

This function produces a generator and lazily loads results. That is, service calls will only be made to fetch more data when needed as we iterate through results produced by the generator; this contrasts with the eagarily loaded list_call_get_up_to_limit() function, which makes all the required service calls when it is called.

The generator also supports vending two types of objects - either the raw responses received from calling the list operation, or the individual model objects which are contained within the response’s data attribute (which should be a list of model objects).

Parameters:
  • list_func_ref (function) – A reference to the list operation which we will call
  • record_limit (int) – The maximum number of records to fetch. We may fetch less records than this if the total number of records is less than this value. If a record_limit is not provided then we will only fetch a single page of data
  • page_size (int) – The number of records to retrieve per list operation call
  • yield_mode (str) – Either response or record. This will control whether the generator returned by this function yields either Response objects (if the value is response), or whether it yields the individual model objects which are contained within the response’s data attribute (which should be a list of model objects)
Returns:

A generator that, depending on the yield_mode, will yield either Response objects or the individual model objects which are contained within the response’s data attribute (which should be a list of model objects)