Version 1 Base Classes

These classes are what pyTenable < 1.2 used for all interactions. They are here as most of the library will still use it until these have been phased out in favor of the newer RESTfly-derived classes.

As these classes exist only as a basis for the application packages, it isn’t recommended to use this directly. Further if you’re looking for a generic API interface to use for your own uses, take a look at the RESTfly library.

class APIResultsIterator(api, **kw)[source]

The API iterator provides a scalable way to work through result sets of any size. The iterator will walk through each page of data, returning one record at a time. If it reaches the end of a page of records, then it will request the next page of information and then continue to return records from the next page (and the next, and the next) until the counter reaches the total number of records that the API has reported.

Note that this Iterator is used as a base model for all of the iterators, and while the mechanics of each iterator may vary, they should all behave to the user in a similar manner.

count

The current number of records that have been returned

Type

int

page

The current page of data being walked through. pages will be cycled through as the iterator requests more information from the API.

Type

list

page_count

The number of record returned from the current page.

Type

int

total

The total number of records that exist for the current request.

Type

int

next()[source]

Ask for the next record