ironic.api.controllers.v1.collection module¶
- ironic.api.controllers.v1.collection.get_next(collection, limit, url, key_field='uuid', **kwargs)[source]¶
Return a link to the next subset of the collection.
- ironic.api.controllers.v1.collection.has_next(collection, limit)[source]¶
Return whether collection has more items.
- ironic.api.controllers.v1.collection.list_convert_with_links(items, item_name, limit, url, fields=None, sanitize_func=None, key_field='uuid', sanitizer_args=None, **kwargs)[source]¶
Build a collection dict including the next link for paging support.
- Parameters:
items – List of unsanitized items to include in the collection
item_name – Name of dict key for items value
limit – Paging limit
url – Base URL for building next link
fields – Optional fields to use for sanitize function
sanitize_func – Optional sanitize function run on each item, item changes will be done in-place
key_field – Key name for building next URL
sanitizer_args – Dictionary with additional arguments to be passed to the sanitizer.
kwargs – other arguments passed to
get_next
- Returns:
A dict containing
item_name
andnext
values