Testing APIs with the IBM DataPower Gateway
Using the API Connect Toolkit with IBM® DataPower® Gateway unlocks the full set of security and policy capabilities for local testing.
Some key benefits of this feature include: Develop and test APIs that use the full complement of IBM API Connect Assembly policies; saved changes are instantly synchronized with the Gateway for rapid testing and feedback; test product and plan level concepts such as rate-limiting; the reserved Catalog name apic-dev is available to provide substitute assembly properties at runtime; DataPower error logging is integrated into the API Designer logging console; Request/Response logging is also available from the logging console with latency data.
Before you begin
- Docker v1.13 or higher.
- Docker Compose v1.11 or higher.
- On the Windows platform, Windows 10 Professional and Docker for Windows are required.
- On the Mac platform, Docker for Mac is required.
- On the Linux® platform, install Docker by following the Docker installation instructions for your particular distribution.
- This feature is not available with IBM API Connect Version 5.0.8.7.
- If you are using a version of Linux that includes Security-Enhanced Linux (SELinux) and you find that, after completing the steps described in this topic, you are unable to call your API, enter the command setenforce 0 to run SELinux in permissive mode, then retry. To verify that SE Linux is running in permissive mode, enter the command sestatus and check the Current mode property.
- When you use Docker for Windows with Windows 10, you must adjust the Docker software settings to share the C: drive. If you choose to install Docker on Windows 7, you must use the Docker Toolbox, which includes Oracle VirtualBox. Under this configuration, Docker containers run in a VM hosted by VirtualBox. Ensure that you increase the VirtualBox resource settings to provide at least 4 GB RAM and 2 CPUs to the Docker VM (usually named
default
).
About this task
gateway: datapower-gateway
as a child of the
x-ibm-configuration:
block. Alternatively you can select the gateway type with the
API Designer
Assembly view, selecting between the Micro Gateway or DataPower provider and press save. The following
entry in your file indicates a selection of the IBM
DataPower Gateway for API testing:
x-ibm-configuration:
# ... other configuration options
gateway: datapower-gateway
When the current project's API definition file includes gateway:
datapower-gateway
, the API is deployed locally on a IBM
DataPower Gateway, which runs within a Docker container on your workstation. When you start the DataPower Gateway, your workstation must download the Docker image from Docker Hub and perform a build step. It can take some minutes to complete this step and another minute or two to start the gateway.
You can update the OpenAPI (Swagger 2.0) YAML file manually, or with the API Designer interface as shown in the instructions that follow.