Skip to content

Instantly share code, notes, and snippets.

@ApigeeSamples
Last active December 12, 2015 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ApigeeSamples/4734267 to your computer and use it in GitHub Desktop.
Save ApigeeSamples/4734267 to your computer and use it in GitHub Desktop.
RouteRule-condition
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<Description>Default Proxy to create flows on an API</Description>
<FaultRules/>
<Flows>
<Flow name="forecast weather">
<Description>Weather forecast endpoint</Description>
<Request/>
<Response/>
<Condition>(proxy.pathsuffix MatchesPath &quot;forecastrss&quot;) and (request.verb = &quot;GET&quot;)</Condition>
</Flow>
</Flows>
<PreFlow name="PreFlow">
<Request>
<Step>
<FaultRules/>
<Name>OAuthV20-1360270147385</Name>
</Step>
</Request>
<Response/>
</PreFlow>
<HTTPProxyConnection>
<BasePath>/v0/weather1</BasePath>
<Properties/>
<VirtualHost>default</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="default">
<TargetEndpoint>default</TargetEndpoint>
</RouteRule>
<!--this RouteRule sends traffic to a different endpoint depending on the day of the week-->
<RouteRule name="default">
<Condition>system.time.dayofweek = 3</Condition>
<TargetEndpoint>XmlTargetEndpoint</TargetEndpoint>
</RouteRule>
</ProxyEndpoint>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment