Skip to content

Instantly share code, notes, and snippets.

Avatar

ApigeeSamples

View GitHub Profile
@ApigeeSamples
ApigeeSamples / gist:4734267
Last active Dec 12, 2015
RouteRule-condition
View gist:4734267
<?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/>
View apikeyval.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GetOAuthV1Info enabled="true" continueOnError="false" async="false" name="Policy-1347578787672">
<DisplayName>Validate API Key Policy</DisplayName>
<AppKey ref="request.queryparam.apikey"></AppKey>
</GetOAuthV1Info>
@ApigeeSamples
ApigeeSamples / assign_message.xml
Created Aug 21, 2012 — forked from evera/assign_message.xml
Assign Message policy examples
View assign_message.xml
<AssignMessage name="create1">
<AssignTo type="[request]/response" createNew="[true]/false">sc.request</AssignTo>
<IgnoreUnresolvedVariables>true/[false]</IgnoreUnresolvedVariables>
// allow any order
<Copy source="request"> // if no children do copy all
<Headers>
<Header name="h1"/>
<Header name="h2"/>
</Headers>
View access_entity.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AccessEntity enabled="true" continueOnError="false" async="false" name="name_of_the_policy">
<FaultRules/>
<Properties/>
<EntityIdentifier ref="reference_to_entity_identified"/>
<EntityType value="type_of_entity"/>
</AccessEntity>
View qouta_sample8.xml
<Quota name="QuotaPolicy">
<Interval>1</Interval>
<TimeUnit>hour</TimeUnit>
<Distributed>true</Distributed>
<Allow count="99" />
</Quota>
@ApigeeSamples
ApigeeSamples / resetquota4.xml
Created Jul 11, 2012
Reset class level quota (if top level quota has been exhausted)
View resetquota4.xml
<ResetQuota name="resetQuota">
<Quota name="quotapolicy">
<Identifier name="_default" allow="200">
<Allow>200</Allow>
<Class ref="request.header.classIdentifier"/>
<Allow>200</Allow>
</Class>
</Identifier>
</Quota>
</ResetQuota>
@ApigeeSamples
ApigeeSamples / resetquota3.xml
Created Jul 11, 2012
Reset class level quota
View resetquota3.xml
<ResetQuota name="resetQuota">
<Quota name="quotapolicy">
<Identifier name="_default">
<Class ref="request.header.classIdentifier">
<Allow>200</Allow>
</Identifier>
</Identifier>
</Quota>
</ResetQuota>
@ApigeeSamples
ApigeeSamples / resetquota2.xml
Created Jul 11, 2012
Reset Top level quota for different identifiers
View resetquota2.xml
<ResetQuota name="resetQuota">
<Quota ref="request.header.quotapolicy">
<Identifier ref="request.header.identifier">
<Allow>100</Allow>
</Identifier>
</Quota>
</ResetQuota>
@ApigeeSamples
ApigeeSamples / resetquota1.xml
Created Jul 11, 2012
Reset Top level quota
View resetquota1.xml
<ResetQuota name="resetQuota">
<Quota name="request.header.quotapolicy">
<Identifier name="_default">
<Allow>100</Allow>
</Identifier>
</Quota>
</ResetQuota>
<ResetQuota name="resetQuota">
<Quota name="request.header.quotapolicy">
@ApigeeSamples
ApigeeSamples / JSONThreatProtection.xml
Created Jun 14, 2012
JSON Threat Protection policy
View JSONThreatProtection.xml
<JSONThreatProtection name="mypolicy">
<Source>request</Source>
<ContainerDepth>10</ContainerDepth>
<ObjectEntryCount>15</ObjectEntryCount>
<ArrayElementCount>20</ArrayElementCount>
<ObjectEntryNameLength>50</ObjectEntryNameLength>
<StringValueLength>100</StringValueLength>
</JSONThreatProtection>