openapi2apigee
module converts a standard Open API spec 2.0 (previously known as Swagger) into an Apigee API Proxy bundle and deploys into an Apigee Edge Organization.
- node.js
You can install openapi2apigee
either through npm
or by cloning the code from this GitHub repo. This README covers the installation steps with npm
.
$ npm install -g openapi2apigee
Generates Apigee API Proxy bundle from OpenAPI specification file and deploys to Apigee Edge Organization.
$ openapi2apigee generateApi petStore -s http://petstore.swagger.io/v2/swagger.json -D -d /Users/me/Desktop/
openapi2apigee Apigee-127 Extensions support
Secure APIs using OAuth 2.0 & Verify API Key Policies in Apigee using OpenAPI 2.0
Project's Dockerfile enables running openapi2apigee
as a Docker
container, eliminating the need to have Node.js installed on the system
where it runs. Having Docker installed is required instead.
Please note that since Docker images are immutable, so generating Proxy Bundle and storing it within the Container for later use makes no sense. Therefore, openapi2apigee Docker container always runs the tool with the -D option, i.e. deploying the Proxy to Apigee.
To build the image, run
docker build --rm -t openapi2apigee .
Following Environment variable could be set to pass command line arguments to the container, when container is run:
- APIGEE_ORG (required): Apigee organization name
- APIGEE_USER_ID (required): Apigee user, typically your email address
- APIGEE_USER_PASSWORD (required): Apigee user password
- APIGEE_PROXY_NAME (required): The name of the Apigee proxy to be created
- OPEN_API (required): URL or content of the OpenAPI/Swagger spec used to generate Apigee Proxy from.
- SERVICE_ENDPOINT_URL (optional): Service URL. If not provided, the one specified in the OpenAPI spec will be used.
- APIGEE_ENVIRONMENTS (optional): Default is 'test'. Apigee environment(s) to which Proxy will be deployed. Multiple environments
could be specified by comma, like
test,prod
. - APIGEE_VIRTUAL_HOSTS (optional): Default is 'default,secure'. Allows specifying Apigee virtual hosts for the target endpoint.
- APIGEE_BASE_URL (optional): Default is 'https://api.enterprise.apigee.com'. Apigee Edge API base URL.
An example of how to run openapi2apigee
as a Docker container:
docker run \
-e APIGEE_ORG=you-org-name \
-e [email protected] \
-e APIGEE_USER_PASSWORD=verySecureP@ssw0rd \
-e APIGEE_PROXY_NAME=my-super-proxy \
-e OPEN_API=https://raw.githubusercontent.com/Azure/api-management-samples/master/apis/httpbin.swagger.json \
openapi2apigee