ironic.api.controllers.v1.collection module¶
-
ironic.api.controllers.v1.collection.
get_next
(collection, limit, url=None, 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=None, fields=None, sanitize_func=None, key_field='uuid', **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
key_field – Key name for building next URL
kwargs – other arguments passed to
get_next
- Returns
A dict containing
item_name
andnext
values