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:
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.
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.
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.
- 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:
- 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:
- 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:
- 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:
- 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:
- Log on to IBM API Connect, and click on â€śDraftsâ€ť in the menu:
- Click on the â€śAPIsâ€ť tab. You can see the pushed REST APIs:
- Click on the â€śProductsâ€ť tab. You can see the pushed product:
- Click on â€śDashboardâ€ť in the menu, and click on the catalog (in this demo, â€śSandboxâ€ť) that you staged the product into:
- Locate the product. It will show as â€śStagedâ€ť.
- Click the â€śâ€¦â€ť to display a menu. Click â€śPublishâ€ť to publish the product and the REST APIs, and make them available for use:
- 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:
- 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:
- 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.
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: