This documentation is for WSO2 API Manager 1.10.0 View documentation for the latest release.
Adding a new Throttling Tier - API Manager 1.10.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

API Manager admins can add new throttling tiers and define extra properties to the throttling tiers. Click the level of throttling that you want to add a new tier in to see instructions:

Adding a new API-level throttling tier

You can do this either using the Admin Dashboard (recommended) or the Management Console.

Using the Admin Dashboard

  1. Log in to the Admin Dashboard Web application using the URL https://localhost:9443/admin-dashboard and your admin credentials.
  2. Click the Throttling Tiers menu. You will be displayed the existing set of Throttling Tiers. To add a new Tier, click the Add New Tier button.
  3. Fill in the details required by this form and click Save once you are done. 

    Given below is a description of the fields you find in the form:

    FieldDescription
    Request CountThe maximum number of requests allowed to the API within the time period given in the next field.
    Unit TimeTime in seconds within which the the number of requests given in the previous field is allowed to the API.
    Stop On Quota ReachThis indicates the action to be taken when a user goes beyond the allocated quota. If checked, the user's requests will be dropped and an error response (HTTP Status code 429) will be given. If unchecked, the requests will be allowed to pass through.
    Billing PlanThis field only makes sense if you have API Monetization enabled. An API is determined as Free, Commercial or Freemium depending on the Tiers it has. If all Tiers of an API are tagged as Free, the API will be labelled as a Free API. This labeling happens on the API Store only if monetization has been enabled. Visit this link to find out how to enable Monetization. 
    Custom AttributesCustom attribute values are displayed as key value pairs on the API Store's API Subscription page. The main objective of these fields are to provide more information regarding the Tier to Application Developers at the time API Subscription.
  4. You have added a new API-level throttling tier.

Next, let's add a new API-level throttling tier using the Management Console.

Using the Management Console

  1. Log in to the API Manager's Management Console (https://localhost:9443/carbon) and select Browse under the Resources menu.
  2. Select the file: /_system/governance/apimgt/applicationdata/tiers.xml.
  3. In the Contents panel, click Edit as text link and the throttling policy opens.

  4. You can add a new policy configuration by editing the XML code. For example, we have added a new tier called Platinum by including the following XML code block soon after the <throttle:MediatorThrottleAssertion> element.

    Tier DisplayName : You can add this optional attribute to each throttle ID of tiers.xml file in order to decouple the throttle policy name defined in tiers.xml from the tier name showing in APIPublisher/Store UIs. That is, a user can add a different throttle display name to appear in APIPublisher/Store UIs without changing the throttle ID policy name. The configuration below has a displayName as platino for the throttle value platinum. This value is displayed in APIPublisher/Store apps.

    Tier Attributes : In the configuration below, there's a commented out XML section starting from the XML tag <throttle:Attributes>. You can use it to define additional attributes related to each throttling tier definition. For example, if the throttling tier Platinum has attributes calledPaymentPlan and Availability, first uncomment the <throttle:Attributes> section and then define the new attributes as follows:

    <wsp:Policy>
     <throttle:ID throttle:type="ROLE" throttle:displayName="platino">Platinum</throttle:ID>
       <wsp:Policy>
         <throttle:Control>
            <wsp:Policy>
              <throttle:MaximumCount>50</throttle:MaximumCount>
                 <throttle:UnitTime>60000</throttle:UnitTime>
                   <!--It's possible to define tier level attributes as below for each tier level.For eg:Payment Plan for a tier-->
                      <wsp:Policy>
                         <throttle:Attributes>
                            <!--throttle:Attribute1>xxxx</throttle:Attribute1-->
                            <!--throttle:Attribute2>xxxx</throttle:Attribute2-->
                            <throttle:PaymentPlan>monthly</throttle:PaymentPlan>
                            <throttle:Availability>FullTime</throttle:Availability>
                         </throttle:Attributes>
                      </wsp:Policy>
            </wsp:Policy>
         </throttle:Control>
       </wsp:Policy>
    </wsp:Policy>
  5. After the edits, click Save Content.

Your new throttling policy (Platinum) is now successfully saved in the Repository used by WSO2 API Manager. You can view this new throttle tier available for selection when creating a new API through the API Publisher.

Adding a new application-level throttling tier

Log in to the Management Console and change the /_system/governance/apimgt/applicationdata/app-tiers.xml registry resource, in the same way described here.

Adding a new resource-level throttling tier

Log in to the Management Console and change the /_system/governance/apimgt/applicationdata/res-tiers.xml registry resource, in the same way described here.


  • No labels