Skip to content

Commit

Permalink
feat: modified pipeline.sh & README
Browse files Browse the repository at this point in the history
  • Loading branch information
anaik91 committed Aug 16, 2023
1 parent d80c5b4 commit fd3ba09
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 0 additions & 4 deletions tools/proxy-endpoint-unifier/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,3 @@ python3 main.py

## Limitations
* This tool does not currently handle the resources within API proxies.

## Copyright

Copyright 2023 Google LLC. This software is provided as-is, without warranty or representation for any use or purpose. Your use of it is subject to your agreement with Google.
19 changes: 18 additions & 1 deletion tools/proxy-endpoint-unifier/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,22 @@ python3 -m pip install -r "$SCRIPTPATH/requirements.txt"
APIGEE_ACCESS_TOKEN="$(gcloud config config-helper --force-auth-refresh --format json | jq -r '.credential.access_token')"
export APIGEE_ACCESS_TOKEN

# Execute Utility
# Building API Proxy Bundle for Proxy containing more than 5 Proxy Endpoints
cd "$SCRIPTPATH/test/api_bundles"
rm -rf "$SCRIPTPATH/test/api_bundles/test.zip"
echo "Building original proxy bundle"
zip -q -r test.zip apiproxy/
cd "$SCRIPTPATH"

# Validating API Proxy Bundle for Proxy containing more than 5 Proxy Endpoints
echo "Validating the original proxy bundle"
python3 -c "import os, sys ,json; \
from apigee import Apigee; \
x = Apigee(os.getenv('APIGEE_X_ORG')); \
x.set_auth_header(os.getenv('APIGEE_ACCESS_TOKEN')); \
r=x.validate_api('apis','test/api_bundles/test.zip'); \
print(json.dumps(r,indent=2))"
rm -rf "$SCRIPTPATH/test/api_bundles/test.zip"

# Running and Validating API Proxy Bundle after splitting the proxies
python3 "$SCRIPTPATH/main.py"

0 comments on commit fd3ba09

Please sign in to comment.