Hi Team,
Please help me out how to extract existing custom reports using management call in apigee Hybrid.
Thanks,
To get the list of custom reports
GET https://apigee.googleapis.com/v1/organizations/:org/reports
Authorization: Bearer :token
To get a specific custom report
GET https://apigee.googleapis.com/v1/organizations/:org/reports/:reportid
Authorization: Bearer :token
To "run" a specific custom report, you need to translate what you get in response to the above, into a call into the /stats API. there is no apigee API that carries the function "run this custom report."
So for example, suppose the output of my query on a specific report is like this:
{
"qualifier": [
{
"name": "142d6de1-5043-4e21-995b-d7f3ed4675f5",
"displayName": "testreport1",
"metrics": [
{
"name": "total_response_time",
"function": "avg"
},
{
"name": "target_response_time",
"function": "avg"
}
],
"dimensions": [
"apiproxy"
],
"createdAt": "1650386316973",
"lastModifiedAt": "1650386316973",
"chartType": "column",
"organization": "my-apigee-hybrid-org"
}
]
}
Then, to run it, I would invoke this /stats call.
GET https://apigee.googleapis.com/v1/organizations/:org/environments/:env/stats/apiproxy?t=agg_percentile&
select=avg(total_response_time),avg(target_response_time)&
sort=DESC&
tsAscending=true&
timeUnit=hour&
accuracy=100&
timeRange=03/19/2022%2015:44:31~04/09/2022%2016:44:31&
sortby=avg(total_response_time),avg(target_response_time)
Authorization: Bearer :token