Can wildcards be used in BasePaths

dave_pickard
Participant III

Is it possible to use wildcards in a BasePath for a proxy? For example, could you have the following URL basepaths going through different proxies

/account/<accountNum>/resourceA/...

/account/<accountNum>/resourceB/...

Whilst you could just have the base path as /account and put everything in one proxy, it would be advantageous to put it under two separate proxies as this would allow a more granular release approach. I.e. if I make a change to resourceB I just have to re-release that proxy and don't have to worry about retesting anything under resourceA.

2 6 1,130
6 REPLIES 6

Not applicable

Nope its not possible to use wildcards. Let me think how to implement your scenario and get back..

Not applicable

Hi @Dave Pickard , I don't think you can do that as of now .

You can use variables in conditions but not in Basepath .

Not applicable

The wildcard syntax for base path does in fact work - though as noted variables do not.

In your example the base path /account/*/resourceA is distinguishable from /account/*/resourceB by the classification features of the router. Generally the logic works from most specific to least specific with the most specific match being the chosen route. Of course test this in your environment!

Not applicable

You can see an example of this at:

http://davidwallen2014-test.apigee.net/foo/foo/a?x=y

vs.

http://davidwallen2014-test.apigee.net/foo/bar/a?x=y

Which has a base path of:

    <HTTPProxyConnection>
        <BasePath>/foo/*/a</BasePath>
        <VirtualHost>default</VirtualHost>
    </HTTPProxyConnection>

Note the caveat that the wildcard must be a full path element for the classification engine to work as expected. Also, the web UI does not support creating a new proxy with a wildcard in the base path. You may create the proxy without the wildcard and subsequently edit it to include the base path successfully using the web UI.

Not applicable

Cool. This is news to me. I remember there was a chat about this in the past with other folks at Apigee. Maybe this was incorporated as part of a new release.

CC - @Dino, @Terry David. I can't recall either of you asked about it.

Thanks @Diego Zuluaga - I had asked about that not too long ago!