REST API Pagination
Use pagination parameters with the REST API to control the amount of data that is returned and to retrieve specific items from a response.
You can select and limit the data that is provided by the REST API by using the same clusters endpoint. For example, if you want to get the 3rd item only, you can specify the limit and offset as follows:
curl -k -s -v "https://lynx.tuc.stglabs.ibm.com/api/cartridgePools?limit=1&offset=2" -H "Authorization: Bearer xxxxx"
Note: The provided curl command syntax may not work under Windows environment, it depends on the
application to run the curl command. You may need to adjust the command syntax if it does not
work.
Sample response:
[
{
"cartridgePolicyName": "cartridge pool 2",
"cartridgePolicyUUID": "e25b6cef-53c9-4c0e-97ef-b10388636055",
"defaultAutoLabelType": "ibmi",
"description": "Pool for cartridge cartridge pool 2",
"name": "cartridge pool 2",
"uuid": "3805232c-a035-49d6-9e6a-826eed91fb91"
}
]
Note: The offset starts from 0 (that is, the 1st entry is offset=0).
Note:
-If offset is specified more than the actual resources, HTTP RC=400 (bad request) is returned.
-If a limit is specified more than the actual resources, all resources are returned.