API proxy list being used by developer app

Not applicable

Hi,

Could you please let me know if we have any management API for getting the list of API proxies being used in a developer app.

I understand that we can find keys of key value scope of specific developer using below example management API. But I'm looking for list of API proxies used by a developer app during a specific time.

https://api.enterprise.apigee.com/v1/organizations/{org_name}/developers/apps/{app_name}

Thanks.

Solved Solved
0 2 11.5K
1 ACCEPTED SOLUTION

There are two possible sources of data that may be of interest to you:

For a list of API Proxies used by a developer app, you can query the /stats API and collect that data. That tells you which APIs have actually been invoked. For example, if you know the name of the developer app, then this query gives you the data for the list of api proxies invoked (and the count of invocations) for a particular developer app:

curl -i -n "$mgmtserver /v1 /o /$ORG /e /$ENV /stats /apis ? select=sum(message_count)&timeRange=10/03/2018%2000:00~10/11/2018%2023:59&filter=(developer_app%20in%20'MyTestApp')"

NB: eliminate the spaces in that URL. If I leave the spaces in, this forum doesn't display the content.

Let's break that down.

"$mgmtserver /v1 /o /$ORG /e /$ENV /stats /apis "
		
this is the base URI for querying things on apiproxies. You need to specify an environment.
select=sum(message_count)
		
This asks for the message count for each API Proxy
timeRange=10/03/2018%2000:00~10/11/2018%2023:59
		
This specifies a one-week time range
filter=(developer_app%20in%20'MyTestApp')"
		
limit the data to retrieve to a specific developer app

The result is something like this:

{
  "environments" : [ {
    "dimensions" : [ {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "23.0" ]
      } ],
      "name" : "Provider1_OAuth"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "281.0" ]
      } ],
      "name" : "proxy1"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "1.0" ]
      } ],
      "name" : "proxy2"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "2.0" ]
      } ],
      "name" : "Provider2_OAuth"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "82.0" ]
      } ],
      "name" : "Provider3_OAuth"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "370339.0" ]
      } ],
      "name" : "proxy3"
    } ],
    "name" : "ENV"
  } ],
  "metaData" : {
    "errors" : [ ],
    "notices" : [ "Table used: uap-prod-gcp-us-west1.edge.edge_api_raxgroup021_fact", "Source:Big Query", "query served by:35911877-5164-4ec2-98b0-7b5311855d00" ]
  }
}

Each of those name entries specifies the name of an API Proxy. You can also sort by sum(message_count), if you like. Consult the doc on the stats API to see the syntax.

You could also use the Apigee Admin UI to create a custom report to do the same thing. The custom report feature in the Edge Admin UI allows you to click through some buttons to ask for the same data; basically you are visually constructing that query.

Separately, you can query the developer apps to see which API Products they are authorized for, and which API Proxies are contained within those products. That tells you which proxies the app is _authorized to call_, not the list of proxies the app is actually calling. But it sounds like you don't want this.

View solution in original post

2 REPLIES 2

There are two possible sources of data that may be of interest to you:

For a list of API Proxies used by a developer app, you can query the /stats API and collect that data. That tells you which APIs have actually been invoked. For example, if you know the name of the developer app, then this query gives you the data for the list of api proxies invoked (and the count of invocations) for a particular developer app:

curl -i -n "$mgmtserver /v1 /o /$ORG /e /$ENV /stats /apis ? select=sum(message_count)&timeRange=10/03/2018%2000:00~10/11/2018%2023:59&filter=(developer_app%20in%20'MyTestApp')"

NB: eliminate the spaces in that URL. If I leave the spaces in, this forum doesn't display the content.

Let's break that down.

"$mgmtserver /v1 /o /$ORG /e /$ENV /stats /apis "
		
this is the base URI for querying things on apiproxies. You need to specify an environment.
select=sum(message_count)
		
This asks for the message count for each API Proxy
timeRange=10/03/2018%2000:00~10/11/2018%2023:59
		
This specifies a one-week time range
filter=(developer_app%20in%20'MyTestApp')"
		
limit the data to retrieve to a specific developer app

The result is something like this:

{
  "environments" : [ {
    "dimensions" : [ {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "23.0" ]
      } ],
      "name" : "Provider1_OAuth"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "281.0" ]
      } ],
      "name" : "proxy1"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "1.0" ]
      } ],
      "name" : "proxy2"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "2.0" ]
      } ],
      "name" : "Provider2_OAuth"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "82.0" ]
      } ],
      "name" : "Provider3_OAuth"
    }, {
      "metrics" : [ {
        "name" : "sum(message_count)",
        "values" : [ "370339.0" ]
      } ],
      "name" : "proxy3"
    } ],
    "name" : "ENV"
  } ],
  "metaData" : {
    "errors" : [ ],
    "notices" : [ "Table used: uap-prod-gcp-us-west1.edge.edge_api_raxgroup021_fact", "Source:Big Query", "query served by:35911877-5164-4ec2-98b0-7b5311855d00" ]
  }
}

Each of those name entries specifies the name of an API Proxy. You can also sort by sum(message_count), if you like. Consult the doc on the stats API to see the syntax.

You could also use the Apigee Admin UI to create a custom report to do the same thing. The custom report feature in the Edge Admin UI allows you to click through some buttons to ask for the same data; basically you are visually constructing that query.

Separately, you can query the developer apps to see which API Products they are authorized for, and which API Proxies are contained within those products. That tells you which proxies the app is _authorized to call_, not the list of proxies the app is actually calling. But it sounds like you don't want this.

thanks for guiding me for so many solutions with one solution 🙂