Showing posts with label API Manager. Show all posts
Showing posts with label API Manager. Show all posts

Wednesday, December 16, 2015

#463 SOA CS --> API Manager Flavour

This is essentially a revamp of a previous post on API Manager,
albeit for the SOA CS environment.

You can read the original post here

I created an API Manager instance on SOA CS -















Here are the menu options -
















Let's look at the Fusion Middleware Control -
Here we can create API Manager users.
I have covered this is a previous API Manager post, but to save you time,
here are the screenshots -




























I create 2 users, curator, consumer -














Set the roles -





















Above, the 2 api manager roles.
I assign my users to these.





I can now login to the API Manager Portal -

Url format: https://yourAPIManagerHost:7002/apimanager




















The catalog is empty -










I create a simple credit card validation service and deploy it to a war file.























I then go to the weblogic console of API Manager and deploy the war.











































Check out the WSDL

-


Now I go to the service bus console on API Manager -

Here I create a simple Service Bus process to call the web service and
validate a credit card.



















I test the Proxy Service -


























Next step is to publish the proxy, so that it will appear in the catalog -




















Now I go back to the API Manager Portal -















Managed / Unmanaged

From the docs:

A managed API is an access-controlled API. Per-user metrics are also available for
managed APIs. In order to successfully invoke a managed API, a user will first need to
create an application and subscribe to a given managed API. The client must then invoke
the API providing the API Key for the call to be successful.

Unmanaged APis can be invoked without subscription and without passing an
entitlement key at runtime.

Here are the details from the console -
















So how do I make this managed?
Simply go back to the SB console and set it.










The API Manager console is updated accordingly -











Now how does a consumer use this API?


Login to the portal as the consumer user -
















Subscription is done via applications -













Now I just need to click on the icon on the right, to add the ValCC API.

































Note the API Key: c77ab0d8-abc7-4d95-96fa-22fbba99077a

Embed this entitlement key as a http user header - X-API-KEY when invoking the API
X-API-KEY: c77ab0d8-abc7-4d95-96fa-22fbba99077a

The following test from SOAP-UI was done on another cloud instance, hence the different X-API-KEY value -























I get the following response, if I delete the header from the request -





























Wednesday, May 20, 2015

#401 API Manager basics

Introduction


A short introduction to the product -

post #378 described how to install, let's now look at what we get.

To quote the ORCL docs -

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 built on Oracle Service Bus. Proxy services created using Service Bus
can 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 a developer portal, from which application developers subscribe to and view
information necessary to consume the APIs. Administrative users can use the
developer portal to monitor usage metrics and performance analytics at runtime.

Now to the roles -

API Curator: Users with this role use the Service Bus Console to curate the
metadata associated with and expose proxy services as APIs through the API
Manager Developer 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 Developer Portal to
view, subscribe to, and consume 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 Developer 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.

Now that we have the general idea of what API Manager is, let's take a look at the components -

I will begin with em - because this is where you create the api manager users.

Create API Manager users in EM





















Here are the roles -










Assign our new consumer user to this role -






Assign our new mgr user to this role -









API Manager Portal

http://localhost:7001/apimanager

login as MyAPIConsumer/welcome1



Note the 3 tabs on the right -






Logout and login as MyAPIManager/welcome1









Service Bus Console

Here I have a simple SB pipeline that routes a request to a simple credit card
validation service I created.



































I edit the API values -


















Once published, we can see it in the portal -











Managed/ Un-managed?


















So what does this checkbox mean?

Back to the ORCL docs for an explanation -

A managed API is an access-controlled API. Per-user metrics are also available for
managed APIs. In order to successfully invoke a managed API, a user will first need to 
create an application and subscribe to a given managed API. 
The client must then invoke the API providing the API Key for the call to be successful.

Unmanaged APis can be invoked without subscription and without passing an
entitlement key at runtime.

API Subscription

Back in the portal as the consumer user -




















The consumer subscribes to APIs via an Application.








































Select the API -


















































Note the key - 9b0d5689-30b0-4b1f-bda7-09b3625348b1