Search apps using custom attributes

0 3 676

The following is a POC and is no way near production ready.

Problem statement:

If you have hundreds of apps and one of the key attributes for the app is a custom attribute . Today there is no way to search the app by a custom attribute.

Why is this important: When a developer or app is created in Apigee EDGE by default Apigee creates it’s own developer/app ID.

App,App family,Company,Key,Consumer Key,Consumer Secret and Registered are the supported attributes for searching among apps. There is no way to search with a custom attribute.

Lots of companies store an internal ID (might be a salesforce identifier of the developer or the app or any other internal identifier of that particular entity) against the Apigee entity. And it might be easier to search using that internal ID.

Solution: We are taking the app object from Edge and then storing that in BaaS. We are then using BaaS’s built in Search capabilities to search for the app using custom attributes.

Following are the steps to get it done:

Deploy the app :

Get the source from the below github repo:

https://github.com/anubis05/Search-app-by-custom-attributes

once deployed the app will expose a URL like the following :

http://<base_url>/migrate-edge-app?appId=<appID> (Yaah , the appID is not a query , BAD Api design)

Where the appId can be retrieved from

https://api.enterprise.apigee.com/v1/o/pixvy/apps or or from a number of other APIs. Details of different APIs to retrieve the ID can be found here and here.

Call this URL at app creation from dev portal (or the invocation point can be anything).

Once the apps are stored in BaaS one can make the following call to search for a particular app :

ql=select * where attributes.value contains ‘<custom_attribute_value>'

Challenges with the approach:

We have a data duplication now. So for solving one problem we might have created a bigger challenge.

App’s can be updated from the following interfaces:

From the management UI

From the Developer portal

From management API

And with the solution built so far it won’t automatically sync the data across the two sources.

Possible workarounds:

Instead of (Or along with) running this script for per app creation run this as a scheduled job which when run will update all the previously stored app data.

Comments
adas
Participant V

@sarthak This looks like a long shot but given the current limitations, this might be one of the few ways to implement this. With CPS, we are going to allow a set of searchable attributes, so once the CPS migration is complete and the next phase completed, we might be able to support this out of the box.

sarthak
Participant V

I agree that this is a long shot , but I was given this problem by a customer and I know of atleast a few different current customers who needs something like this. Till the time CPS rolls out completely this might be the only way to achieve this.

Not applicable

@sarthak, Nice to see this kind of tool.

One other option to consider is to get this information directly from Cassandra if the customer is on private-cloud.

Version history
Last update:
‎10-21-2015 06:57 PM
Updated by: