pyrax
Python Bindings for the Rackspace Cloud
|
This object will iterate over all the results for a given type of listing, no matter how many items exist. More...
Public Member Functions | |
def | __init__ |
def | __iter__ |
def | next |
Return the next available item. | |
Public Attributes | |
manager | |
marker | |
limit | |
results | |
list_method | |
marker_att | |
extra_args | |
next_uri |
This object will iterate over all the results for a given type of listing, no matter how many items exist.
This is an abstract class; subclasses must define the _init_methods() method to specify what manager method should be called to get the next batch of results. Both the equivalent of 'list()' and '_list()' may be specified You may also specify any extra args to be sent when this method is called.
By default the marker will be unspecified, and the limit will be 1000. You can override either by specifying them during instantiation.
The 'kwargs' will be converted to attributes. E.g., in this call: rit = ResultsIterator(mgr, foo="bar") will result in the object having a 'foo' attribute with the value of 'bar'.
def __init__ | ( | self, | |
manager, | |||
marker = None , |
|||
limit = 1000 , |
|||
kwargs | |||
) |
def __iter__ | ( | self | ) |
def next | ( | self | ) |
Return the next available item.
If there are no more items in the local 'results' list, check if there is a 'next_uri' value. If so, use that to get the next page of results from the API, and return the first item from that query.
Reimplemented in StorageObjectIterator.
Reimplemented in StorageObjectIterator.