Homepage
  • Arm Pelion logo
  • Services
    • Connectivity Management
    • Device Management
    • Data Management
  • Documentation
  • Support
    • Technical Support
    • Forum
  • Blog
  • Product Enquiry
  • Management consoles
    • Management consoles:

    • App switcher Connectivity (Stream IoTx)
    • App switcher Device
    • App switcher Data (Treasure Data)

Documentation

Mistake on this page? Email us

Pagination¶

The API provides a paginated response to requests, encapsulated in the Python client, returning an object that you can use to iterate over and explore the data.

from mbed_cloud import ConnectAPI
api = ConnectAPI()
paginator = api.list_connected_devices()
print(paginator.count())
print(paginator.first())
print(len(paginator))
for d in paginator:
  print(d)

Reference¶

Pagination

class mbed_cloud.pagination.PaginatedResponse(func, lwrap_type=None, _results_cache=True, page_size=None, max_results=None, **kwargs)¶

Initialize wrapper by passing in object with metadata structure.

Parameters:
  • func – API function called to obtain a page of results
  • lwrap_type – Wrapper class called for each returned result object
  • _results_cache – Retains a copy of all returned results to reduce API calls Set to None to disable (for use as a pure generator, and to reduce memory usage)
  • page_size – Number of results to request per page
  • max_results – Total maximum number of results to retrieve
all()¶

All results

count()¶

Approximate number of results, according to the API

data¶

Deprecated. Returns the data as a list

first()¶

Returns the first item from the query, or None if there are no results

next()¶

Next item in sequence (Python 2 compatibility)

to_dict()¶

Internal state

Table Of Contents

  • SDK Interface
  • Foundation Interface
  • Client Interface
  • Legacy Interface

Concepts

  • Subscriptions

Change History

  • Pelion Device Management SDK for Python
  • 2.2.0 (2019-06-14)
  • 2.1.0 (2019-05-17)
  • 2.0.8 (2019-05-13)
  • 2.0.7 (2019-05-13)
  • 2.0.6 (2019-03-05)
  • 2.0.5 (2019-02-26)
  • 2.0.4 (2018-11-30)
  • 2.0.3 (2018-11-07)
  • 2.0.2 (2018-09-28)
  • 2.0.1 (2018-09-07)
  • 2.0.0 (2018-08-07)
  • 1.2.10.1235 (2018-07-05)
  • 1.2.9.1210 (2018-06-27)
  • 1.2.8.1183 (2018-06-11)
  • 1.2.8.970 (2018-05-22)
  • 1.2.7.968 (2018-03-27)
  • 1.2.6.852 (2018-03-08)
  • Older releases

Quick search

Copyright © 2019 Arm Limited (or its affiliates).
  • Home
  • Website Terms
  • Pelion Device Management Terms
  • Privacy
  • Cookies
  • Trademarks
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.