DIY Exercise 5-1 - Deploy and Secure An API
DIY Exercise 5-1 - Deploy and Secure An API
Objectives
In this exercise, you deploy and secure an API implementation. You will:
• Deploy a Mule API application to CloudHub.
• Create simple test flows to automatically set sample required headers and parameters before
calling an API endpoint.
• Create an API proxy for a Mule application and apply an SLA based rate limiting policy.
Scenario
The Accounts API has been implemented as a Mule application and you are now ready to deploy it to
CloudHub. After deploying the Mule application, secure it by creating an API proxy for it and applying
an SLA based rate limiting policy.
For each flow, set example values for any required parameters and headers according to the accounts-
api.raml specification in the project's src/main/api folder. In order to trigger each test flow, use one
shared HTTP Listener configuration, listening on port 9090.
Note: This is an alternate way to test your API without using the mocking service or a separate REST
client.
1
Test access to the API endpoints via the test endpoints
Use a web client to make requests to your test flow URLs at http://localhost:9090/{yourTestEndpoint}.
2
Now that the Mule application is deployed and tested, secure the API by creating an API proxy for it
and then apply a rate limiting SLA based policy with the following SLA levels:
• Free (with automatic approval)
• Professional (with manual approval)
• Enterprise (with manual approval)