Problem to generate ASM reports using iControl REST API
I'm having trouble to use iControl API do generate BIG-IP reports. I need to connect to IControl API to collect reports of ASM statistics to feed an external tool with monitoring dasboards. I managed to extract simple data such as Statistics of a LTM Pool, or details of an ASM Policy, but I could not use the reports endpoint provided by iControl API. For reference I can generate a basic report of ASM Violations using TMSH but could not do the same using iControl Rest API:
TMSH:
show analytics asm-violation report view-by policy limit 10 range now-1d
iControl:
POST https://Management-IP/mgmt/tm/analytics/asm-violation/report
JSON sent in the HTTP BODY:
{
"limit": 10,
"range": "now-1d",
"viewBy": "policy"
}
I believe that I'm strugglin to generate a valid JSON with the parameters to use on the request. I'm getting the JSON reference to be used from the API itself, making a GET on /example at the end of the Endpoint. In this case: GET https://Management-IP/mgmt/tm/analytics/asm-violation/report/example
From the reference JSON retrieved I manage to shape it just with the necessary parameters to use on the request to generate the report with the data that I need. For this specific case I'm having this response from iControl API:
{
"code": 403,
"message": "Operation is not allowed on component /analytics/asm-violation/report.",
"errorStack": [],
"apiError": 1
}
I'm using these documents as references to understand how to connect to iControl Rest API and generate reports:
https://cdn.f5.com/websites/devcentral.f5.com/downloads/bigip-analytics-rest-api-user-12-0-0.pdf
https://cdn.f5.com/websites/devcentral.f5.com/downloads/icontrol-rest-api-user-guide-16-1-0.pdf
P.S.: I'm using Postman to simulate the client during these tests to validate the request to be used by the external tool that will connect direct to iControl API to generate these reports.