Nodegrid RESTful API's: How to paginate requests
Nodegrid's RESTful API's: How to paginate requests
Nodegrid's RESTful API's support pagination. Pagination is used to break down larger datasets into smaller pages. Each page is then requested separately. This helps to improve the system performance.
Pagination is enabled by default for all API requests, this means only the first page is returned by default. This behaviour can be changed using the Query Parameters and setting the page value.
page value
| result
|
0
| disable pagination
|
1
| return the first page (default)
|
2-n
| return page 2 to n
|
Examples
- url = 'https://{0}/api/v1/devices/table'.format(ip_addr)
-
try:
-
resp = requests.get(url = url,
-
headers = headers,
-
params = { "page": "0" },
-
verify = False,
-
timeout = 30)
-
except Exception as e:
-
print('Failed to get devices:', str(e))
-
return None
Related Articles
How to find the RESTful API documentation in Nodegrid WebUI
The Nodegrid platform provides RESTful API, which can be used to read and change Nodegrid configuration. The API documentation is embedded on Nodegrid. One can find the API documentation on WebUI as folllows, 1. Login as admin and go to System 2. Go ...
How to: Use API keys as authentication method
Nodegrid enables using different methods for API authentication, they are: ticket, username, and API key. In this guide you will learn how to create an API account and how to query information using the API. Adding the API account from GUI 1. Login ...
How to Configure Nodegrid Serial Ports
To configure the serial ports of your Nodegrid Serial Console, follow the guideline steps below. WebUI Log in as admin to the Nodegrid Serial Console Web interface. Go to Managed Devices page. Select the serial ports you want to configure, or check ...
Password Encryption for automation scripts
For automation you may need to encrypt passwords for security reason. For example with ZTP/ansible or with ZPE Cloud you may have scripts to change a password. Openssl is the tool to use. The example below will encrypt your password with MD5-based ...
Nodegrid Serial Console: Pinouts, Cables and Connectors
The tables below show the serial port pinout information of the NSC TxxR (Cisco Pinout) and NSC Txx (Legacy Pinout). NSC TxxR - Cisco-like Pinout Pin Signal Name Input/Output 1 CTS IN 2 DCD IN 3 RxD IN 4 GND N/A 5 GND N/A 6 TxD OUT 7 DTR OUT 8 RTS ...