Cisco Cisco Prime Performance Manager 1.7 開発者ガイド

ページ / 44
 
Cisco Prime Performance Manager 1.7 REST API Guide 
Accept=text/csv;q=0.5,application/pdf?q=0.7,application/xml;q=0.9, 
application/vnd.cisco.ppm+json;v=2;q=0.95 
For the above HTTP Accept header, the media-range with the highest q-factor is: 
application/vnd.cisco.ppm+json;v=2 followed by application/xml, 
application/pdf, and text/csv. 
In this case, the REST API selects application/vnd.cisco.ppm+json;v=2 as the response 
format type which is the media-range with the highest q-factor. 
The Accept header “application/vnd.cisco.ppm+json;v=2” can be used to select the newer 
JSON format, which is simpler to traverse through the reporting data than the previous JSON version. 
This HTTP Accept header has the same effect as passing outputType=jsonv2 as a query string 
parameter. 
Note: a 406 status is returned for an Accept header that is not supported by the REST API. 
5.1.1.1 Accept Header Preference 
If the Accept header contains multiple supported media types, the REST API uses the HTTP Accept 
header “q” (quality factor) to determine the preferred client media type, as explained above. However, if 
the supported media-types have the same q (quality factor) values, the REST API selects the media range 
using the following order of precedence: 
csv - > json - > xml - > png - > jpeg - > pdf  
For example, if the following HTTP Accept header is sent to the REST API: 
Accept=text/csv;q=0.5,application/pdf,application/xml 
The selected media range should be “application/xml”. 
5.2 Character Set Encoding 
The REST API defaults all the text (XML, JSON, CSV) responses to the UTF-8 charset encoding, 
irrespective of the charset value requested by the client on the HTTP header request.  
5.3 URI Syntax 
The REST API calling URI syntax is defined as follows: 
Table 2 – URL Syntax 
URL Syntax 
For network/node level web reports: 
{scheme}://{host}:{port}/ppm/rest/{reportType}/{resource}?{parameters=…}.. 
Table 3 – URL Parts 
URL Parts 
Sample Value 
Description 
scheme 
http or https 
Use https when Prime Performance Manager 
SSL is enabled; otherwise, it should be http. 
host 
For example: “ppm-clean.cisco.com” 
The host name assigned to the Prime 
Performance Manager gateway server. 
Note: use your own domain/host name.