This is only applicable if you wish to import your APIs from WSO2 API Manager.
It is possible to create a Microgateway distribution for a group of APIs that exist in WSO2 API Manager (WSO2 API-M), by simply importing the group of APIs based on a preferred Microgateway label, which has been assigned to the group of APIs in WSO2 API Manager. Similarly, you can also use a Microgateway label to import a single published API from WSO2 API Manager as well if required.
Follow the instructions below to create a Microgateway distribution for a group of APIs that you have imported from WSO2 API Manager.
Step 1 - Follow the installation prerequisites
Make sure to carry out all the installation prerequisites.
Step 2 - Assign an API to an API Microgateway
Create and attach a Microgateway to an API. For more information, see one of the following links based on the WSO2 API Manager version that you are using.
- Follow the instructions in the Grouping APIs with Microgateway Labels page in the WSO2 API Manager 3.0.0 documentation.
- Follow the instructions under the Creating and attaching a Microgateway to an API section in the WSO2 API Manager 2.6.0 documentation.
Step 3 - Generate a Microgateway project
Follow the instructions below to generate a Microgateway project for a group of APIs that correspond to a specific Microgateway label.
Initialize an API Microgateway project (e.g., marketing_project).
Navigate to a preferred folder where you want to create the Microgateway project. Thereafter, run the following command.
Import the APIs, which are published in WSO2 API Manager, that correspond to a specific Microgateway label.
WSO2 API Microgateway Toolkit prompts for the following.
Username and Password - Enter your user credentials. The username and password should correspond to a valid user in WSO2 API Manager
APIM base URL - This is the WSO2 API Manager URL. If you want to use the default value, click enter.
Trust store location and password of WSO2 API Microgateway Toolkit - If you want to use the default value, click enter.
After the APIs are imported, you can find the auto-generated OpenAPI definitions in the
<MGW-project>/gen/<OpenAPI_definition-file-name>.JSONdirectory of the project (e.g.,
Step 4 - Build the Microgateway
Build the WSO2 API Microgateway project (e.g.,marketing_project).
Navigate to the
<MGW_HOME>/bindirectory and run the following command.
This creates an executable file (
/marketing_project/target/marketing_project.balx) that you can use to expose the group of APIs via WSO2 API Microgateway.
Step 5 - Run the Microgateway
Start WSO2 API Microgateway.
WSO2 API Microgateway starts for the APIs, which are grouped with the