What is an API??
Application program interface (API) is a set of routines, protocols, and tools for building software applications. An API specifies how software components should interact. Additionally, APIs are used when programming graphical user interface (GUI) components. A good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together.
With this API, new term API manager comes, API management is the process of publishing, documenting and overseeing application programming interfaces (APIs) in a secure, scalable environment. The goal of API management is to allow an organization that publishes an API to monitor the interface’s lifecycle and make sure the needs of developers and applications using the API are being met.
API management software tools typically provide the following functions:
- Automate and control connections between an API and the applications that use it.
- Ensure consistency between multiple API implementations and versions.
- Monitor traffic from individual apps.
- Provide memory management and caching mechanisms to improve application performance.
- Protect the API from misuse by wrapping it in security procedures and policies.
In recent Oracle Cloud, they added a feature of API Management which is available on oracle soa cloud with "12.1.3 Services".
So here question come, What is oracle API Manager....
Source @Oracle Cloud Documentation..https://docs.oracle.com/middleware/1213/apimgr/using-apimgr/GUID-07B22F10-7674-4BAA-90EA-8E6431942F22.htm#OSBAM111
Oracle API Manager facilitates the creation of APIs that expose functionality of backend systems or other services. These APIs are published for use by application developers and are managed and monitored at runtime.
API Manager is installed with a standalone Oracle Service Bus instance, with which developers can create WSDL-based SOAP proxy services and REST proxy services to be published as APIs.
API Curators decide which of these services should be managed and exposed to developers. API Curators then add metadata and publish the APIs to the API Manager Portal, from which application developers subscribe to and view information necessary to consume the APIs. Administrative users can use the API Manager Portal to monitor usage metrics and performance analytics at runtime.
(This is something we call SOA Governing in Oracle OSB 11G, where you can expose your OSB service to some governing manager with them you manage service life cycle) or we call it UDDI.
Oracle API Manager Features:
Create an API: Use Service Bus facilities to create proxy services to publish as APIs for a variety of backend services.
Add descriptive metadata and publish API to Portal: Users with the API Curator role add decorative metadata to APIs, decide if APIs should be managed, and publish APIs to the API Manager Portal.
Discover and understand APIs: Users with the API Consumer role use the API Manager Portal to search for APIs of interest, explore their metadata and test the API to understand its capabilities.
Create applications and subscribe to APIs: Applications that reflect your organization's applications must be created in API Manager. After applications are created, users with the API Consumer role can subscribe APIs to applications.
Access the APIs at runtime: After users have subscribed to APIs they are interested in, users can use an endpoint URL and entitlement key to access the backend service (published as an API).
Use analytics to understand API performance: Users with the API Admin role monitor subscription data and various runtime analytics with the API Manager Portal.
User Roles in Oracle API Manager:
- API Curator: Users with this role use the Service Bus Console to curate the metadata associated with and publish proxy services as APIs to the API Manager Portal. Users assigned this role have read-only access to the remainder of the Service Bus Console so they can view artifact information.
- API Consumer: Users with this role can use the API Manager Portal to view, subscribe to, and consume APIs. Users can also view runtime metrics for managed APIs. Users assigned this role have no access to the Service Bus Console.
- API Admin: Users with this role have administrative privileges for the API Manager Portal. API Admin users can view API usage metrics, analytics information, and detailed subscription information for each User and API. Users assigned this role have no access to the Service Bus Console.
The following Service Bus roles are also used with API Manager:
- Developer: Users with this role use the Service Bus Console to create proxy services that can be published as APIs on the API Manager Portal.
- Administrator: Users with this role have full access to the Service Bus Console and the API Manager Portal, in addition to full access to Oracle WebLogic Server. Users assigned this role cannot subscribe to assets using the API Manager Portal.
- Deployer: Users assigned this role are responsible for deploying the APIs, including both Service Bus artifacts and curation information. This role maps to the existing Deployer Service Bus role, with the additional responsibility of importing/exporting curation metadata.
- Monitor: Users assigned this role are responsible for monitoring
You need to select 12.1.3 Services. Then only you will get API manager, in previous version of SOA no API manager is available.
Here you need to select API manager cluster as Service Type and provide all details that we provided at the time of SOA Instance Creation, You need to make sure to provide storage user name & password which is a new user created only for Storage admin access, Also provide DB details of SYS level because we are going to create new instance of SOA where RCU/OSB/SOA & other will be installed.
You will see a confirmation screen if all configuration is correct, Validate it and finish click.
After create process finish, you will see a new instance with name “API Manager has been created”, it takes time to create and make it up, Wait for it.
Instance creation will take time from 50-60 minutes, Wait for completion of instance.
API manager instance creation done now you can work with it.
Click on APIManager instance.
Accessing the Oracle API Manager Developer Portal:
o access the Oracle API Manager Developer Portal, you need the IP address of the load balancer being used.
To obtain the load balancer IP address:
- Log in to the Oracle SOA Cloud Service Console.
- Click the provisioned API Manager Cloud Service instance.
- From the menu at the right, select Open Load Balancer Console or any of the other console options.
4. Copy the IP address from the Load Balancer Console URL or any of the other console options.
5.Include this IP address in the URL of the Oracle API Manager Developer Portal:
https://Load_Balancer_IP_Address:7002/apimanager
in my case login URL
https://PUBLIC IP:7002/apimanager/faces/loginToAPIManager
After login you will see API manager page with no API, you need to create your first API with OSB console, But it will not help you to subscribe any service here, As you see there is no option available.
You need to create two user one is API consumer and other one API Manager.
Create one new user with user name “MyAPIConsumer” & “MyAPIManager”.
Login into EM Console.
Now we need to assign consumer and manager/admin level Roles to these newly created users.
We need to create a REST service which can be expose over API manager.
Make a sample OSB project in Jdev and deploy it on OSB cloud OSB console.This OSB service was based on WADL, basically it was a SOAP service which was exposed as rest. You can do it easily in JDEV (If you have query over this sample Project let me know. Will make a separate post SOAP TO REST)
Go to Rest Service Proxy and Click on API Tab. Click on first EDIT button
Click on published value from Status drop down and click save.
Now you can login into API manager with “MyAPIConsumer” or “MyAPIManager” or”weblogic” user and you can see service is available there.
Now we will login with “MyAPIConsumer”, so we can subscribe it and will generate a KEY which will send in request header to access it.
Login with consumer user then you can see dashboard, where it will show consumed web services.
Create an API application with click on Pink colour icon. I created a sample project TESTAPI, Click on this project.
Click on “Add API”.
Here you will see your restAPI which was publish to API manager.
Take cursor on Rest Service and you will see a “Select button” over it, Click on it.
Now you can Rest service in right side tab of “Selected API”
Click on “Subscribe button” top to “Selected API” window.
It’s added successfully, Now you can test with provide KEY that is just below “Test API” project.
When you click on “Details button”, You will see all details.
You will see all details with including API URL for testing.
Click on API URL and you will see associated WADL.
API Testing:I made one more OSB project which support SOAP protocol and made test from API over SOAP UI.
You will receive URL of WSDL.
http://Load Balancer Public IP/WheatherTestSOAPProxy/ProxyService?WSDL
Open SOAP UI and add this URL for testing.
When we execute sample request to API manager, it will refuse it due to no security key passing in request header.
Without security keys, you will receive authentication error.
You need to add “X-API-KEY” with key value “ea6b9a23-014c-44d8-9f22-d535fca50db9”, which you can found by taking cursor over KEY.
Add this key in SOAP UI request.
It's working now!!!
Hope you enjoyed it.. Happy Clouding.. :)
Comments
Post a Comment