Additional answers may be found in the getting started section about the Prime Infrastructure API, and in the tutorial.
The general structure of a request to the Prime Infrastructure API is as follows:
../webacs/api/v4/data/{RESOURCE-NAME}
This will list all instances of that resource. For example, ../webacs/api/v4/data/Devices will return a list of all Device instances in the system.
../webacs/api/v4/data/{RESOURCE-NAME}/{RESOURCE-ID}
This will return the unique instance identified by the given {RESOURCE-ID}. For example, ../webacs/api/v4/data/Devices/12412764 returns the "12412764" device.
Qualifiers may be added to use filtering, paging and sorting following this format:
../webacs/api/v4/data/{RESOURCE-NAME}?{operator-expression1}&{operator-expression2}...&{operator-expressionN}
Each operator expression may be a filtering criteria such as ipAddress="192.168.1.3", or a paging directive, or a sorting directive, such as .sort=-collectionTime.
Optionally, the .full=true qualifier may be added to return the full instance.
Additional RESTful services are available through the following URL pattern:
../webacs/api/v4/op/{service-domain}/{service-resource}
For example, ../webacs/api/op/reportservice/templates provides a way to list all report templates that may be used to create reports.
The response to a request to the Prime Infrastructure API may be returned in one of two standard formats: XML or JSON. The format of the response may be specified in one of two ways:
../webacs/api/v4/data/Devices.json?ipAddress="192.168.8.9"returns a response in JSON format, whereas
../webacs/api/v4/data/Devices.xml?ipAddress="192.168.8.9"returns a response in XML format.
Accept: application/jsonreturns a response in JSON format, whereas
Accept: text/xmlreturns a response in XML format.
By default, when nothing is specified, the response format is set to be XML.
If you would like to cut down the latency of API requests, or improve throughput, you can try some of the following tips:
../webacs/api/v4/data/Devices?.nocount=trueDoing so will remove the "count," "first," and "last" attributes from the API response. However, the API will require one less query against the underlying data source, yielding a lower latency.
If you sometimes receive HTTP 503 errors, but at other times receive a success response, you are being rate limited. The best thing to do in this case is to wait for a few seconds and try the same request again. For more details, please see our rate limiting documentation.
When your Prime Infrastructure is configured to do AAA through TACACS/ACS, you will sometimes get periodic or random 401 errors. This is because of timeouts and unresponsiveness in the connection between Prime Infrastructure and the ACS server. To help reduce the frequency of these events, please increase the timeout and retry count that you've configured in the settings for Prime Infrastructure.
This is a known issue when using JSON and the v1 API. We recommend switching to the v3 (or v2) API to address this issue.
To address a security vulnerability, third party software used in Prime Infrastructure was changed to no longer accept any characters in a URL outside of the reserved and unreserved characters defined in RFC 3986. When such characters are received, an empty HTTP 400 response is sent. To avoid this issue, percent-encode characters not valid in a URL, like double quotes (change double quotes to '%22'). Note that some clients will automatically encode such characters.