apiconnect-mgmt-lite-datapower
v1.1.10
Published
Using docker-compose start DataPower and some minimal API Connect Management server functions to aid in the test and development of APIs using the toolkit and DataPower specific policies
Downloads
96
Readme
Running DataPower via apic start
Using docker-compose start DataPower and some minimal API Connect Management server functions to aid in the test and development of APIs using the toolkit and DataPower
Learn more about the developer toolkit here
Install Docker and Docker Compose
Install the API Connect Toolkit
npm install apiconnect -g
Note: When installing as part of apiconnect
from the pre-staging registry for development testing, be sure to
include the --no-shrinkwrap
flag.
Create a new project
mkdir ~/demo; cd ~/demo
apic loopback # pick the defaults
<edit definitions/demo.yaml and add gateway: datapower-gateway as shown below>
apic start
<after sometime>
apic services
curl -k https://127.0.0.1:4002/api/Messages/greet -H "X-IBM-Client-Id: default" -H "X-IBM-Client-Secret: SECRET"
Add gateway:
to definitions/demo.yaml, should look like this:
assembly:
execute:
- invoke:
target-url: $(runtime-url)$(request.path)$(request.search)
gateway: datapower-gateway
Connect to the DataPower GUI
Use docker ps
to determine the WebUI port
tonyf-mbp-ibm:apiconnect-mgmt-lite-datapower tonyf$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
348cc421ba0d ibm-apiconnect-toolkit/datapower-api-gateway:1.0.0 "/bin/drouter" 33 minutes ago Up 5 minutes 0.0.0.0:32770->80/tcp, 0.0.0.0:4002->443/tcp, 0.0.0.0:32769->5554/tcp, 0.0.0.0:32768->9090/tcp demo_datapower-api-gateway_1
000f9841f325 ibm-apiconnect-toolkit/datapower-mgmt-server-lite:1.0.0 "node lib/server.js" 33 minutes ago Up 5 minutes demo_datapower-mgmt-server-lite_1
In this case... https://0.0.0.0:32768
Running with API Connect v6 DataPower Gateway (experimental)
Login to Artifactory with Docker
In order to download the experimental v6 DataPower Gateway, you must sign-in to our Artifactoy repository on Docker:
$ docker login datapower-docker-local.artifactory.swg-devops.com
Username: [email protected]
Password: (your ibm intranet password)
Login Succeeded
Configure and run your project
In your API Connect project, run the following command to configure the toolkit to use the v6 DataPower Gateway:
apic config:set datapower-api-gateway-experimental=true
Then start the gateway normally, with apic start
or through the API Designer.
NOTE: You may need to set the environment variable IBM_APICONNECT_APIC2DP_BAIL_ON_COMPILE_ERROR=false
when starting
your project if you are testing APIs that use unsupported assembly actions:
IBM_APICONNECT_APIC2DP_BAIL_ON_COMPILE_ERROR=false apic start
Export your project from the API Gateway to deploy on another appliance
While your gateway is still running, run docker ps
to determine the WebUI port
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cf027b41e7a3 ibm-apiconnect-toolkit/datapower-api-gateway-v6:1.0.5 "/bin/drouter" 17 seconds ago Up 16 seconds 0.0.0.0:32823->80/tcp, 0.0.0.0:4002->443/tcp, 0.0.0.0:32822->5554/tcp, 0.0.0.0:32821->9090/tcp myapp_datapower-api-gateway_1
b6946378a75a ibm-apiconnect-toolkit/datapower-gateway-director:1.0.5 "node lib/gateway-..." 18 seconds ago Up 17 seconds 0.0.0.0:32820->2443/tcp myapp_datapower-gateway-director_1
Now point your browser to the WebUI path, in this case https://0.0.0.0:32821
After logging in as admin
, follow these steps:
- Find and select Export Configuration
- Under Backup and export options, select "Create a backup of one or more domains" and press Next
- Under Domains to export, on the Export package screen, select
apiconnect
and press Download
After your exported configuration has been downloaded, it can be imported into another API Gateway
More Information
For more information about testing API Connect policies locally with the IBM DataPower Gateway, please see our official documentation here.