CA API Developer Portal: Adjusting the rate limit for the API Plans fragment

book

Article ID: 110204

calendar_today

Updated On:

Products

CA API Developer Portal CA API Gateway

Issue/Introduction



How can I adjust the rate limit settings for the API Plans fragment?

 

Environment

API Developer Portal 3.x

Resolution

1. SSH into your API Portal and edit this file on all Portal nodes of the cluster: 
/opt/Deployments/lrs/server/webapps/ROOT/templates/apiplan.xml 

2. Find the section that looks like this: 
<L7p:RateLimit> 
<L7p:CounterName stringValue="${service.oid}-${apiKey}"/> 
<L7p:Enabled booleanValue="{{RateLimitEnabled}}"/> 
<L7p:HardLimit booleanValue="true"/> 
<L7p:MaxRequestsPerSecond stringValue="{{MaxRequestRate}}"/> 
<L7p:ShapeRequests booleanValue="false"/> 
<L7p:WindowSizeInSeconds stringValue="60"/> 
</L7p:RateLimit> 

and change it to look like this: 
<L7p:RateLimit> 
<L7p:CounterName stringValue="${service.oid}-${apiKey}"/> 
<L7p:Enabled booleanValue="{{RateLimitEnabled}}"/> 
<L7p:MaxRequestsPerSecond stringValue="{{MaxRequestRate}}"/> 
<L7p:ShapeRequests booleanValue="false"/> 
<L7p:WindowSizeInSeconds stringValue="5"/> 

3. Save the file, then restart the API Portal service: 
service apiportal restart 

Then you will want to do the following to resync the API Plans to have the Rate Limit Assertion updated with the "spread limit over" value: 

4. Login to your API Portal's CMS as an administrator (http://<portal-hostname>/admin) 
5. Click on "Plugin Administration" on the left side. 
6. Click on "Layer 7 Gateway" 
7. Click on "Sync API Plans" 
8. Refresh your Policy Manager and re-open the API Plans fragment, you should see the Rate Limit assertion updated with the "Spread Limit Over" value selected.