I currently writing a script to count all proxies we have in prod.
To do this I currently send a request to https://api.enterprise.apigee.com/v1/organizations/{org_name}/environments/{env_name}/deployments
and then for each name I make a request to https://api.enterprise.apigee.com/v1/organizations/{org_name}/apis/{name} to check if it is a proxy or a shared flow. I do this by checking the subType in the response. However on some of them the subType is set to null.
{ "metaData": { "createdAt": 1553585811540, "createdBy": "example@example.com", "lastModifiedAt": 1553585811540, "lastModifiedBy": "example@example.com", "subType": "null" }, "name": "Party_Management", "revision": [ "1" ] }
Olof, as I see https://api.enterprise.apigee.com/v1/organizations/{org_name}/environments/{env_name}/deployments API resource returns a response in the following format:
{ "aPIProxy" : [ { "name" : "{proxy-name}", "revision" : [ { "configuration" : { "basePath" : "/", "configVersion" : "...", "steps" : [ ] }, "name" : "1", "server" : [ { ... "status" : "deployed", "type" : [ "message-processor" ], ... }, ... ], "state" : "deployed" } ] }... ] } ], "name" : "{env-name}", "organization" : "{org-name}" }
Does it really include shared flows? I deployed few shared flows on a selected environment and tested but above API resource does not seem to include shared flows.
Not all but some of the shared flows are in that list.
I have 10 proxies in prod according to Apigee web UI and also when I cross check the output from deployments. I get 5 shared flows in that deployments list (I have 20 shared flows in prod in total)