This sample shows how to implement composite APIs (e.g. mashup) using Apigee's ServiceCallout Policy and ExtractVariables Policy
Let's get started!
- Provision Apigee X
- Configure external access for API traffic to your Apigee X instance
- Access to deploy proxies, create products, apps and developers in Apigee
- Make sure the following tools are available in your terminal's $PATH (Cloud Shell has these preconfigured)
- gcloud SDK
- unzip
- curl
- jq
- npm
Use the following GCP CloudShell tutorial, and follow the instructions.
- Clone the
apigee-samples
repo, and switch to thecomposite-api
directory
git clone https://github.com/GoogleCloudPlatform/apigee-samples.git
cd apigee-samples/composite-api
- Edit
env.sh
and configure the following variables:
PROJECT
the project where your Apigee organization is locatedAPIGEE_HOST
the externally reachable hostname of the Apigee environment group that contains APIGEE_ENVAPIGEE_ENV
the Apigee environment where the demo resources should be created
Now source the env.sh
file
source ./env.sh
- Deploy Apigee API proxies
./deploy-composite-api.sh
To run the tests, first retrieve Node.js dependencies with:
npm install
and then run the tests:
npm run test
If you want to clean up the artifacts from this example in your Apigee Organization, first source your env.sh
script, and then run
./clean-up-composite-api.sh