An Apigee API proxy sits between clients and servers to intercept requests that can be managed and processed per requirements. It can be used to implement multiple API endpoints in a single proxy by defining multiple ProxyEndpoints. This allows you to reuse policies and/or business logic before and after the invocation of a TargetEndpoint.
However, there are also some drawbacks to defining multiple ProxyEndpoints in a single API proxy which are listed below
Multiple ProxyEndpoints in an API proxy can:
When you are implementing a new API proxy or redesigning an existing API proxy, use the following best practices:
Using one ProxyEndpoint per API proxy leads to:
The API Proxy Endpoint Unifier is a tool to help you align with the best practice recommendations which are mentioned above. The objective of this tool is to take a proxy bundle and intelligently convert its proxy endpoints into logically grouped conditional flows. This is achieved by analysing the proxy bundle and identifying which proxy endpoints can be grouped together logically. The tool then generates a new proxy bundle with the grouped proxy endpoints converted into conditional flows. This ensures that the new proxy bundle stays within the Proxy Endpoint limit and keeps it aligned to the best practices.
This is not an officially supported Google product.
Clone the repo and move to the tool directory
git clone
https://github.com/apigee/devrel.gitcd
devrel/tools/proxy-endpoint-unifier/
python3
python3 -m pip install -r requirements.txt
input.properties
[common]
input_apis=apis # Folder Containing exported & unzipped Proxy Bundles
processed_apis=transformed # Folder to export transformed Proxies to
proxy_bundle_directory=zip_bundles # Folder to export transformed Proxies Bundles (zip)
proxy_endpoint_count=4 # Number of Proxy Endpoints to retain should be between 1 to 5
debug=false # Flag to export debug logs
[validate]
enabled=true # Flag to enable proxy validation
gcp_project_id=xxx-xxx-xxx # Apigee Project for proxy validation
export APIGEE_ACCESS_TOKEN=$(gcloud auth print-access-token)
Run the script as below
python3 main.py
Limitations
You’ve done a great job Mr @ashwinknaik explaining the impact of multiple ProxyEndpoints in Apigee. Essentially, having too many can complicate management and analytics. It’s usually best to use a single ProxyEndpoint per API for simplicity and better metrics. Your recommendations are solid, but adding some examples or details about the tool might help. Overall, clear and useful!