Introduction

In the first release of IBM Integration Bus V10, we introduced support for building REST APIs from a Swagger document. We have continued to build on this capability in V10 fix packs – fix pack 2 introduced toolkit support for pushing REST API definitions into IBM API Management, and fix pack 4 introduced toolkit support for developing REST APIs from scratch using graphical tooling in the toolkit.

We have been continuing to extend our REST API support, and in fix pack 5 we have introduced support for pushing REST API definitions into IBM API Connect from the web UI and the command line.

IBM API Connect 5.0 is the latest version of IBM’s API management solution (formally called IBM API Management), which provides a full set of features for managing the life cycle of your REST APIs. The most important features of this solution for IBM Integration Bus users are:

Management
REST APIs pushed in IBM API Connect can be published to your wider organization via customizable portals that allows developers to quickly discover and consume those REST APIs. Those developers can register their applications using these portals, and sign up to plans that define which operations they are permitted to access and what usage/rate limits their applications are subject to.

Monitoring and analytics
REST APIs pushed into IBM API Connect can be monitored and their usage analyzed using graphical tooling built into the web console. The IBM API Connect tooling allows you to monitor a wide range of metrics, such as the most active APIs, the number of API calls, and response times/latency.

Security
IBM API Connect offers fine grained control over security for REST APIs. You can secure a REST API using HTTP Basic Authentication, an API key (a secret key generated for an individual application), and OAuth 2.0. Security options can be specified for the whole REST API, or individual operations within that REST API. It also offers control over who is permitted to see and subscribe for REST APIs.

What does the push process do?
When you push REST APIs that are deployed in IBM Integration Bus into IBM API Connect using either of the new features (walkthrough below), IBM Integration Bus creates or updates configuration in IBM API Connect.

For each REST API that you choose to push, the Swagger document for that REST API is extracted from the integration server. The Swagger document is first modified so that it contains an IBM API Connect assembly.

An IBM Connect assembly is the implementation of that REST API in IBM API Connect. Because the REST API is implemented in IBM Integration Bus, we need to forward the requests onto the integration server HTTP listener that is hosting the REST API. Therefore, we automatically add an assembly that tells IBM API Connect to forward (proxy) all of the HTTP requests for the REST API to the integration server HTTP listener.

Once the assembly has been added into the Swagger document, then the modified Swagger documents for all of the REST APIs being pushed are added in to the Draft area in IBM API Connect. The Draft area contains APIs and products that can be staged into an environment at a later time. If the API already exists in the Draft area, then it will be overwritten without warning.

Next, an IBM API Connect product is created in the Draft area. A product is a collection of APIs. All of the REST APIs that are being pushed are automatically added to this product. The product also contains definitions of which plans are available for this product. A plan is a set of APIs and operations, along with policy control over rate limiting and subscription approvals. The functionality discuss here will create a default plan with no limits and no subscription approvals. If you require these features, then you will have to edit the product in IBM API Connect after it has been created by IBM Integration Bus.

The final and optional step is to stage the created product into a sandbox catalog. When an API is in the Draft area of IBM API Connect, it is not available for calls from HTTP clients. In order for the API to be available for calls, the product must be staged into a catalog. A catalog defines configuration about where the APIs will be hosted (an IBM DataPower Gateway), developer portal, permissions, and application subscriptions.

Once the product has been staged, you must publish it so that it becomes available for developers to consume. The publishing step is not handled by the new features. You must perform this task yourself in the IBM API Connect interface.

When the API has been published, it is available for HTTP clients to call. HTTP clients make a call to a URL handed out by IBM API Connect. This URL points at an IBM DataPower Gateway appliance that is responsible for enforcing access and policy control on the API requests. If the request is permitted, the IBM DataPower Gateway appliance forwards the request onto IBM Integration Bus. The HTTP clients do not connect directly to IBM Integration Bus.

picture1

Pushing REST APIs into IBM API Connect using the web UI
You can use the IBM Integration Bus web UI to push deployed REST APIs into IBM API Connect. We have added a new option to the integration server menu. You need read access to the integration server in order to perform this operation. The option will not be available if you do not have any REST APIs deployed.

  1. Access the menu on the integration server and choose “Push REST APIs to IBM API Connect”. The “Push REST APIs to IBM API Connect” wizard will appear:
    picture2
  2. Fill out the connection details to your installation of IBM API Connect, and click the “Connect to IBM API Connect” button to test the connection. If the connection is successful, then the “Next” button will be enabled. Click the “Next” button:
    picture3
  3. Choose the organization that will host the REST APIs. Specify a product title, name, and version for the product that will contain the REST APIs. The product name will be generated for you when you edit the product title field. Finally, if you want the product to be staged, then choose the catalog to stage the product into. Once the page has been filed in, click the “Next” button:
    picture4
  4. Choose the REST APIs that you wish to push to IBM API Connect. All selected REST APIs will be added into the product defined on the previous page. Once the REST APIs have been selected, click the “Push to IBM API Connect” button:
    picture5
  5. The REST APIs will be pushed into IBM API Connect. The page will update as the REST APIs are pushed. After the process has finished, click the “Close” button to close the dialog:
    picture6
  6. Log on to IBM API Connect, and click on “Drafts” in the menu:
    picture7
  7. Click on the “APIs” tab. You can see the pushed REST APIs:
    picture8
  8. Click on the “Products” tab. You can see the pushed product:
    picture9
  9. Click on “Dashboard” in the menu, and click on the catalog (in this demo, “Sandbox”) that you staged the product into:
    picture10
  10. Locate the product. It will show as “Staged”.
    picture11
  11. Click the “…” to display a menu. Click “Publish” to publish the product and the REST APIs, and make them available for use:
    picture12
  12. The product and the REST APIs are now available for consumption by other members of your organization with access to the IBM API Connect developer portal. The product should appear on the front page of the developer portal, and also on the “API Products” tab:
    picture13
  13. By clicking on the “Detail” button on the product, you can see the REST APIs that are available in the product. There is a “Subscribe button” that lets you subscribe to use the REST APIs. You can also download Swagger documents for each REST API that can be used in conjunction with a Swagger client to invoke that REST API:
    picture14
  14. Each operation listed in the REST API details page includes details of how to call that operation using a variety of programming languages. It also includes a test tool for users to enter data and submit requests to that operation. As discussed earlier, each request you make using the information on this page, or in the Swagger document, will go through to IBM API Connect before it is forwarded onto IBM Integration Bus.
    picture15
Pushing REST APIs into IBM API Connect using the command line
We have also added a command line application, mqsipushapis, that provides the same functionality as that provided by the web UI. This command line application can be integrated into your continuous delivery pipelines or deployment automation to automatically push REST APIs into IBM API Connect as they are updated.

The syntax is described in the Knowledge Center and in the command help. There is a one liner for performing all of the steps that were described for the web UI:
picture16

Conclusion
In this article, you have seen how you can use new functionality introduced in fix pack 5 to push a set of REST APIs deployed in IBM Integration Bus into IBM API Connect, where you expose those REST APIs to other development teams within your organization.

We will be following up this article with another article that demonstrates how you can use this new functionality to push to IBM API Connect running on the cloud, in the Bluemix environment – allowing you to expose your REST APIs to a much wider set of consumers!

You may also be interested in:

3 comments on"Expose your integrations to your organization as REST APIs using IBM Integration Bus and IBM API Connect"

  1. Partha_wipro October 03, 2018

    Is there any way to publish IIB SOAP API or SOAP services using API Connect?

  2. Jose Antonio Roa February 09, 2017

    Hi !
    Very Useful and easy to follow. THANKS for Sharing !!!

    Thanks
    J@

  3. Very nice. Well illustrated step by step walk though of the new function on both sides (IIB and API Connect). Thanks Simon.

Join The Discussion

Your email address will not be published. Required fields are marked *