Cisco Cisco Prime Performance Manager 1.2 Guía Del Desarrollador
Cisco Prim e Perform ance Manager REST API Guide
Copyright 2012 Cis co Systems
- 25 -
7 Pagination
T he reports retrieved from the REST API has a upper limit set to 1000 records per page unless modifie d
by the “ maxPage Size” parameter. If a report has more than 1000 records, the report is divide d into pages.
T he first REST response will contain the first 1000 records along with a “ Content-Range” header (refer to
HTT P Response Header s section of this document).
by the “ maxPage Size” parameter. If a report has more than 1000 records, the report is divide d into pages.
T he first REST response will contain the first 1000 records along with a “ Content-Range” header (refer to
HTT P Response Header s section of this document).
When the report is broken into multiple pages, you need to pass the “pageIndex” parameter to navigate to
the next pages. In this case, you need to pass the pageIndex parameter to go to the next pages. You should
rely on the returned “ Content-Range” value to determine which page is returned, an d how many pages the
report contains.
the next pages. In this case, you need to pass the pageIndex parameter to go to the next pages. You should
rely on the returned “ Content-Range” value to determine which page is returned, an d how many pages the
report contains.
T he following table shows a report sample that displays the “ pageIndex” request parameter and a
“ Content-Range” header response.
“ Content-Range” header response.
Table 32 - CSV Request / Response Sampl e Showing Pagination (Content-Rang e Head er)
Request
GET /ppm/rest/reports/Availability/Interfaces/Interface++Availability?
pageIndex=3
HTTP/1.1
Host: ppm-cls-vm05.cisco.com:4440
Connection: Keep-Alive
User-Agent: RestClient-Tool
Response – Notice the “Content-Range” header indicating pagination.
HTTP/1.1 206 Partial Content
Transfer-Encoding: chunked
Transfer-Encoding: chunked
Date: Wed, 28 Mar 2012 21:38:10 GMT
Content-Type: text/csv;charset=UTF-8
Content-Type: text/csv;charset=UTF-8
Server: Apache-Coyote/1.1
Content-Range: pages 3/11
Cache-Control: no-cache
Device, Interface, Timestamp EDT, Interface Index,Interface Availability Percentage
Down,Interface Availability Percentage Up,Interface Availability Percentage Timeout
spgw-o-sami03,testing-GigabitEthernet0/0,04/23/2012 10:00:00,2,0.0,100.0,0.0
Down,Interface Availability Percentage Up,Interface Availability Percentage Timeout
spgw-o-sami03,testing-GigabitEthernet0/0,04/23/2012 10:00:00,2,0.0,100.0,0.0
spgw-o-sami03,Loopback50,04/23/2012 10:00:00,5,0.0,100.0,0.0
spgw-o-sami03,mwtm_test1-GigabitEthernet0/0.10,04/23/2012 10:00:00,6,0.0,100.0,0.0
spgw-o-sami03,mwtm_test1-GigabitEthernet0/0.10,04/23/2012 10:00:00,6,0.0,100.0,0.0
spgw-o-sami03,NVI0,04/23/2012 10:00:00,7,0.0,100.0,0.0
NAM-172.20.110.196,MGMT PORT-MGMT PORT,04/23/2012 10:00:00,1,0.0,100.0,0.0
NAM-172.20.110.196,MGMT PORT-MGMT PORT,04/23/2012 10:00:00,1,0.0,100.0,0.0
NAM-172.20.110.196,DATA PORT 1-DATA PORT 1,04/23/2012 10:00:00,2,0.0,100.0,0.0
NAM-172.20.110.196,DATA PORT 2-DATA PORT 2,04/23/2012 10:00:00,3,0.0,100.0,0.0
NAM-172.20.110.196,DATA PORT 2-DATA PORT 2,04/23/2012 10:00:00,3,0.0,100.0,0.0
NAM-172.20.110.196,NDE-172.20.122.2-ID-520-NDE-172.20.122.2-ID-520,04/23/2012
10:00:00,7,0.0,100.0,0.0
10:00:00,7,0.0,100.0,0.0
NAM-172.20.110.196,NDE-172.20.122.2-ID-0-NDE-172.20.122.2-ID-0,04/23/2012
10:00:00,8,0.0,100.0,0.0
. . . .
. . . .
8 References
Fielding, R. T . “ Architectural Styles and the Design of Network-base d Software Architectures” . Ph.D.
dissertation, University of California, Irvine, 2000.
dissertation, University of California, Irvine, 2000.
Richardson, L. & Ruby, S. (2007). RESTful Web Service s. Se bastopol, CA : O'Reilly Media.
Bernes-Lee, T ., Fielding, R. T ., et al. Uniform Resource Identifier (URI): Generic Syntax, RFC 3986,
RFC Editor, 2005 (http://www.rfc-e ditor.org/rfc/rfc3986.txt).
RFC Editor, 2005 (http://www.rfc-e ditor.org/rfc/rfc3986.txt).