The objectives are:
- to securely expose an existing API, with perhaps some little modifications
- to manage the API subscriptions
- to retrieve the API analytics report
Steps:
- On the API Management server, the API description needs to be retrieved by importing the API swagger file. This file will be parsed to recreate the API’s operations.
- Once the API defined, an assemble flow needs to be created, it can add some custom security policies, it will make the HTTP call to z/OS Connect EE and it allows to add some pre-request/post-request process (e.g. modify JSON, transform to XML, etc.).
In API Connect, there is a notion of Product, API and Plan. A Product contains APIs and should at least have a subscription Plan. So the API needs to be added into a Product, and a subscription Plan using the API needs to be defined.
Finally, it’s the Product that gets published.
- During the publish process, the API Management server will send the Product configuration to the API Gateway.
- During the publish process, the API Management server will send the Product information to the Developer Portal to make it public.
II. Creating a LoopBack Application and Securing it
The objectives are:
- to create a LoopBack application that will expose datasources that don’t have a REST API.
And furthermore in a LoopBack application, a logic can be implemented to aggregate data from different datasources. In the chart above, the LoopBack application aggregates data coming from z/OS Connect EE API and from Cloudant.
- to securely expose the LoopBack APIs, with perhaps some little modifications
- to manage the API subscriptions
- to retrieve the API analytics report
This approach allows you to enhance existing APIs by creating a unique API that is the composition of the existing ones.
Steps:
- On the Developer Toolkit, the LoopBack application is created with configurations to the datasources and data model definitions. Then an assemble flow needs to be created for that LoopBack API (exactly like in the previous workflow) on the Developer Toolkit.
When ready to publish, an Application and Catalog target must be chosen, they need to be defined in the API Management server first. On publish, the application and definitions are archived and sent over to the API Management server.
- Upon receiving the archive, the API Management server forwards the archive to the chosen Liberty Collective for the LoopBack application.
- As for the assemble flow configuration it will be forwarded to the API Gateway.
- During the publish process, the API Management server will send the Product information to the Developer Portal to make it public.
Try it out!
To sum up, API Connect can be either used with your existing APIs or with a newly created API using your existing resources (services, databases). It then adds a security layer on top and manages the access and deployment. And finally, the managed APIs are exposed on a Developer Portal where application developers will begin to consume them.
Now that you know what can be done with API Connect, it’s time to go try it out!
For more information, see LoopBack and API Gateway policies.