Cisco Cisco Prime Performance Manager 1.5 Entwickleranleitung
Cisco Prime Performance Manager1.5 REST API Guide
5.9.1 Accept
Table 33 – Accept HTTP Header
Header Name
Notes
Accept
The requested content-type for the response. This header indicates to the
REST API server the media type of the response that the client expects. When
this header is present, the REST API attempst to respond to the client using
the client’s Accept header preferred media type; unless, that content-type is
not supported.
The REST API implements the Accept header as specified per the Internet
HTTP standards defined in the chapter 14.1 of the RFC 2616, Hypertext
Transfer Protocol – HTTP/1.1.
Note:the “outputType” parameter overrides the Accept header. This means
that if the “outputType” parameter is found in the request, the Accept
header is not processed.
If the Accept header contains multiple media types supported by the REST
API, the corresponding q-factor value is used to determine the best media
type. If there is a match, the REST API chooses the first media range type
found on the Accept header.
The “application/vnd.cisco.ppm+json;v=2” can be used to
select the json version 2 report formats. The JSON version 2 is a simpler data
structure that is easier to traverse than the previous version.
Example to select the JSON version 2 (simpler JSON format):
Accept=application/vnd.cisco.ppm+json;v=2
Example to select PDF from the Accept header:
Accept=application/pdf
Example to select CSV:
Accept=application/pdf;q=0.5, text/csv;q=0.8
Example to select JSON v2
Accept= application/pdf;q=0.5, text/csv;q=0.8,
application/vnd.cisco.ppm+json;v=2
REST API server the media type of the response that the client expects. When
this header is present, the REST API attempst to respond to the client using
the client’s Accept header preferred media type; unless, that content-type is
not supported.
The REST API implements the Accept header as specified per the Internet
HTTP standards defined in the chapter 14.1 of the RFC 2616, Hypertext
Transfer Protocol – HTTP/1.1.
Note:the “outputType” parameter overrides the Accept header. This means
that if the “outputType” parameter is found in the request, the Accept
header is not processed.
If the Accept header contains multiple media types supported by the REST
API, the corresponding q-factor value is used to determine the best media
type. If there is a match, the REST API chooses the first media range type
found on the Accept header.
The “application/vnd.cisco.ppm+json;v=2” can be used to
select the json version 2 report formats. The JSON version 2 is a simpler data
structure that is easier to traverse than the previous version.
Example to select the JSON version 2 (simpler JSON format):
Accept=application/vnd.cisco.ppm+json;v=2
Example to select PDF from the Accept header:
Accept=application/pdf
Example to select CSV:
Accept=application/pdf;q=0.5, text/csv;q=0.8
Example to select JSON v2
Accept= application/pdf;q=0.5, text/csv;q=0.8,
application/vnd.cisco.ppm+json;v=2
Additional Notes:
The outputType query string parameter overrides the Accept header.
A 406 error status code is returned for an Accept header not supported by the REST API.
5.9.2 Authorization
Table 34 – Authorization HTTP header
Header Name
Notes
Authorization
This request header should be sent to the REST API when the underlying
Prime Performance Manager server has user access enabled. The REST API
follows the HTTP Basic Authentication Scheme standards.The specifics of
how this header should be formatted are defined in the RFC 2616 HTTP 1.1
standards – section 14.8 Authorization of RFC 2616, and in the RFC 2617
HTTP Authentication: Basic and Digest Access Authentication – section 2
Prime Performance Manager server has user access enabled. The REST API
follows the HTTP Basic Authentication Scheme standards.The specifics of
how this header should be formatted are defined in the RFC 2616 HTTP 1.1
standards – section 14.8 Authorization of RFC 2616, and in the RFC 2617
HTTP Authentication: Basic and Digest Access Authentication – section 2