Management API for traffic count/ message_count filtered by hostname

Hi, 

I am using apigee hybrid. I want to use the management api to get the traffic/message count on a hostname. I have the api to get the message-count for any environment. But I couldn't find any api filter for hostname. In UI analyze>Api proxy performance, the data can be filter using the drop-down of Environments/Host Name option. I want to automate the traffic data. So need the management api. 

Regards,

Ayan Biswas

Solved Solved
0 2 138
1 ACCEPTED SOLUTION

The hostStats API can do that for you. For example:

curlx 'https://apigee.googleapis.com/v1/organizations/$ORG/hostStats/apiproxy?select=sum(message_count)&sort=DESC&timeUnit=month&accuracy=100&timeRange=02/01/2023%2000:00:00~05/1/2023%2000:00:00&sortby=sum(message_count)&envgroupHostname=your-host.exco.net'

See: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.hostStats/get

I don't see examples anywhere, but this may help as they are similar: https://cloud.google.com/apigee/docs/api-platform/analytics/analytics-command-reference

View solution in original post

2 REPLIES 2

The hostStats API can do that for you. For example:

curlx 'https://apigee.googleapis.com/v1/organizations/$ORG/hostStats/apiproxy?select=sum(message_count)&sort=DESC&timeUnit=month&accuracy=100&timeRange=02/01/2023%2000:00:00~05/1/2023%2000:00:00&sortby=sum(message_count)&envgroupHostname=your-host.exco.net'

See: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.hostStats/get

I don't see examples anywhere, but this may help as they are similar: https://cloud.google.com/apigee/docs/api-platform/analytics/analytics-command-reference

Hi @kurtkanaskie 

This helped. Thanks