Example: Usage Scenarios of Connecting containerized API Gateway to API Control Plane using Properties

This use case outlines the procedure to connect IBM webMethods API Gateway with API Control Plane using properties.

To establish the connection, configure API Control Plane agent within webMethods API Gateway through a set of properties. For details, see API Control Plane Agent Properties.
Note: API Control Plane is compatible with webMethods API Gateway version 10.15 Fix 10 (10.15.0.10) and above.

To connect webMethods API Gateway with API Control Plane

  1. Configure API Control Plane agent with a set of properties.
    Go to webmethods-api-control-plane\deployment\agent\webmethods-api-gateway using the following command:
    cd webmethods-api-control-plane\deployment\agent\webmethods-api-gateway
    .env file and docker-compose.yml file contains properties related to:
    • webMethods API Gateway deployment configurations lets you specify the metadata of webMethods API Gateway that you want to administer from the API Control Plane such as the webMethods API Gateway name, and so on.
    • API Control Plane configurations let you specify API Control Plane details to which webMethods API Gateway must establish the connectivity.

    You can use the configurations as is or update based on your requirements.

    Important properties to configure in the .env file:
    Property Description
    GATEWAY_IMAGE

    Specify webMethods API Gateway docker image within double quotes.

    Example:

    GATEWAY_IMAGE= "sagcr.azurecr.io/apigateway:10.15.0.11"

    By default, webMethods API Gateway image is specified.

    RUNTIME_NAME Specify the name of your webMethods API Gateway instance.
    CP_USERNAME

    CP_PASSWORD

    Specify the username and password of API Control Plane instance to which webMethods API Gateway must establish connectivity.

    You can also specify the API Control Plane user password against the JAVA_OPTS property in the .env file if you are connecting with API Control Plane for the first time. The password can be removed later as it is saved in webMethods API Gateway passman and used for further restarts.

    Example:

    JAVA_OPTS='-Dapigw_cp_agentConfig_controlPlaneConfig_password=<password>'

    For details about the properties in the docker-compose.yml file, see Connecting webMethods webMethods API Gateway to API Control Plane section in IBM webMethods API Gateway Administration guide. You can update the value of the properties based on your requirements.

  2. Run webMethods API Gateway docker deployment scripts.
    To deploy webMethods API Gateway with the sample configurations specified in the GIT Hub repository:
    1. Go to webmethods-api-control-plane\deployment\agent\webmethods-api-gateway using the following command:
      cd webmethods-api-control-plane\deployment\agent\webmethods-api-gateway
    2. Run the following command:
      docker-compose up -d
      The output must be as follows:
      api-gw-up

      See troubleshooting tips if you face any issue.

  3. Access webMethods API Gateway.
    • Access webMethods API Gateway using http://localhost:9072
    • Login with the following credentials: Username: Administrator, Password: <default_password>

    webMethods API Gateway home page appears.

  4. Access API Control Plane with the url,
    • https://localhost:8080 if API Control Plane is deployed using Docker.
    • https://my-control-plane/ if API Control Plane is deployed using Helm.
    If webMethods API Gateway is successfully connected with API Control Plane, the name and status of webMethods API Gateway gets auto populated on the dashboard and Runtimes screen in API Control Plane.
    Note: If webMethods API Gateway and API Control Plane is deployed in the same host machine, ensure to update the CP_URL as http://172.17.0.1:81 in the agent > .env file and access API Control Plane using https://localhost:8080

    API Control Plane dashboard appears as follows:

    apicp-apigw

    The runtimes screen in API Control Plane appears as follows:

    apigw-apicp-runtimes

    Any transactions that you perform in your webMethods API Gateway instance get synchronized with API Control Plane, enabling you to monitor the metrics in API Control Plane. The interval in which webMethods API Gateway must send the metrics to API Control Plane is defined in the agent configuration, docker-compose.yml file. You can update the configurations based on your requirements.

Troubleshooting Tips:
  1. If webMethods API Gateway is not listed in API Control Plane application after connecting, wait for a few minutes and refresh the API Control Plane application. If it is still not listed, check if webMethods API Gateway container is up and running.
  2. Run the following command to check if the containers are up and running:
    docker ps
  3. If you see the following error message, the container name <abc> is already in use by container <id>, run the following commands to stop and remove the container:
    1. docker stop <container_id>
    2. docker rm <container_id>