Management api to get the list of proxies deployed in environment

Hi

I am trying to get the list of proxies deployed in an environment. I can get the list of proxies available in org, but it doesn't have information about the deployment.

Solved Solved
0 4 327
1 ACCEPTED SOLUTION

There are two ways to do what you want: the hard way and the easy way.  

  • The hard way: query each API Proxy for deployments , and filter the result for the environment of interest. 
  • The easy way: query the environment for deployments.  

For the hard way, you would do something like this: 

GET :apigee/v1/organizations/:org/apis
Authorization: Bearer :gcp-token

# and then, for EACH proxy in the list
GET :apigee/v1/organizations/:org/apis/:api/deployments
Authorization: Bearer :gcp-token

For the easy way

GET :apigee/v1/organizations/:org/environments/:env/deployments
Authorization: Bearer :gcp-token

This is for X/hybrid. If you are working with Apigee Edge, then it's the same call, but your endpoint and authentication changes.

GET :mgmtserver/v1/o/:org/e/:env/deployments
Authorization: Bearer :edge-token 

 

View solution in original post

4 REPLIES 4

There are two ways to do what you want: the hard way and the easy way.  

  • The hard way: query each API Proxy for deployments , and filter the result for the environment of interest. 
  • The easy way: query the environment for deployments.  

For the hard way, you would do something like this: 

GET :apigee/v1/organizations/:org/apis
Authorization: Bearer :gcp-token

# and then, for EACH proxy in the list
GET :apigee/v1/organizations/:org/apis/:api/deployments
Authorization: Bearer :gcp-token

For the easy way

GET :apigee/v1/organizations/:org/environments/:env/deployments
Authorization: Bearer :gcp-token

This is for X/hybrid. If you are working with Apigee Edge, then it's the same call, but your endpoint and authentication changes.

GET :mgmtserver/v1/o/:org/e/:env/deployments
Authorization: Bearer :edge-token 

 

Hi @dchiesa1 

I was using the api you suggested. But it takes a lot of time and eventually doesn't give any output of the api call in opdk. Could you please suggest any other api? 

But it takes a lot of time and eventually doesn't give any output of the api call in opdk.

oh, gosh that's unfortunate.  That seems like a bug ... I suggest you contact Google support on that issue. Be prepared to explain what "doesn't give any output" means. How are you invoking it - curl?  postman?  some other way? What results do you actually see? Does the request time out? Do you get a 200 status code, or something else?  If you "manage" the OPDK, then you might want to look into the management server system.log for clues - maybe an exception is logged there.

Could you please suggest any other api?

Did you try "the hard way", as I suggested above? It will also take a long time, but maybe you will get usable results.

Other than those two ways, there are no other APIs you can invoke to give you the API deployments in a particular environment.

Hi @dchiesa1 

I got the response. Actually the volume is really large and after some time I got the response. Thank you.