Adding resources to an API product based on patterns

Not applicable

I want to add some resources to a API product. The resources are as follows.

/abc/getDetails/12.0/emp
/def/getDetails/12.1/emp
/ghi/getDetails/12.2/emp

While adding the above resources to my API product i am trying the below which is not working

/*/getDetails/*/emp

Can anyone please suggest how can i configure the same in a generic way so that i do not have to add separate resources for the product?

3 6 653
6 REPLIES 6

Hi, @Sridhar Patra .

You can add resource in format /{product}/getDetails/{version}/emp.

Can you clarify what you mean here? I have a feeling that Sridhar was trying to avoid having to do that manually.

Hi @Sridhar Patra,

While adding resources into products only the following 3 wild cards are supported - '/', '/*', and '/**'. You cannot use '*' in between since this is not absolute pattern matching. The scenario you have cannot be represented while adding resources in products Please find more information on how to add resources here - http://apigee.com/docs/developer-services/content/creating-api-products#resourcebehavior

Is there a way this could be done programmatically or via the API that would get around having to do this manually maybe? This seems to make things "air tight" but misses big time on the giving someone the ability to version w/o then having to put a ton of work into updating products.

@Benjamin Goldman

Either you need to use Edge UI or Management API. Either way, the distinct resources have to be added for the above scenario.

The Management API doc can be found here -

For Create Product -

http://apigee.com/docs/management/apis/post/organizations/%7Borg_name%7D/apiproducts

For Update Product - http://apigee.com/docs/management/apis/put/organizations/%7Borg_name%7D/apiproducts/%7Bapiproduct_na... Add the following node for api resources - ["apiResources": [ "{resource1}", "{resource2}", "{resource3}" ],

In my testing, /*/foo/*/bar works. But I've run into other odd behavior, and I asked the question over here: https://community.apigee.com/questions/22964/odd-api-product-enforcement-behavior.html.