forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
87 lines
15 KiB
HTML
87 lines
15 KiB
HTML
<a name="apig-en-ug-180307029"></a><a name="apig-en-ug-180307029"></a>
|
|
|
|
<h1 class="topictitle1">Creating a Request Throttling Policy</h1>
|
|
<div id="body1508204933192"><div class="section" id="apig-en-ug-180307029__en-us_topic_0080103329_section1731012541118"><h4 class="sectiontitle">Scenario</h4><p id="apig-en-ug-180307029__en-us_topic_0080103329_p16503240969">Request throttling controls the number of times an API can be called within a time period to protect backend services.</p>
|
|
<p id="apig-en-ug-180307029__en-us_topic_0080103329_p1931010545114">To provide stable, uninterrupted services, you can create request throttling policies to control the number of calls made to your APIs.</p>
|
|
<p id="apig-en-ug-180307029__en-us_topic_0080103329_p1153112510615">Request throttling policies take effect for an API only if they have been bound to the API.</p>
|
|
<div class="note" id="apig-en-ug-180307029__en-us_topic_0080103329_note103131018162414"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="apig-en-ug-180307029__en-us_topic_0080103329_ul288519471885"><li id="apig-en-ug-180307029__en-us_topic_0080103329_li75974505816">An API can be bound with only one request throttling policy for a given environment, but each request throttling policy can be bound to multiple APIs.</li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li2651165918713">For a dedicated gateway, the limit is the value of <strong id="apig-en-ug-180307029__b14176613302">ratelimit_api_limits</strong> you have configured on the <strong id="apig-en-ug-180307029__b102431142133015">Configuration Parameters</strong> page.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="apig-en-ug-180307029__en-us_topic_0080103329_section83110548119"><h4 class="sectiontitle">Prerequisites</h4><p id="apig-en-ug-180307029__en-us_topic_0080103329_p179881835991">You have <a href="apig-en-ug-180307023.html">published the API</a> to which you want to bind a request throttling policy.</p>
|
|
</div>
|
|
<div class="section" id="apig-en-ug-180307029__en-us_topic_0080103329_section8731554122615"><h4 class="sectiontitle">Creating a Request Throttling Policy</h4><ol id="apig-en-ug-180307029__en-us_topic_0080103329_ol43115541812"><li id="apig-en-ug-180307029__en-us_topic_0080103329_li1831115541819"><span>Log in to the management console.</span></li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li46871818394"><span>In the navigation pane, choose <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b81951343171418">Dedicated Gateways</strong>. Then click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b13200204316144">Access Console</strong> in the upper right corner of a dedicated gateway.</span></li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li1311354012"><span>In the navigation pane, choose <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b511820344123">API Publishing</strong> > <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b121201342126">Request Throttling</strong>.</span></li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li3311165411110"><span>Click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b842352706235557">Create Request Throttling Policy</strong>, and set the parameters listed in <a href="#apig-en-ug-180307029__table1496031175119">Table 1</a>.</span><p><p id="apig-en-ug-180307029__p113459463513"></p>
|
|
<div class="p" id="apig-en-ug-180307029__p9335174610517">
|
|
<div class="tablenoborder"><a name="apig-en-ug-180307029__table1496031175119"></a><a name="table1496031175119"></a><table cellpadding="4" cellspacing="0" summary="" id="apig-en-ug-180307029__table1496031175119" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters for creating a request throttling policy</caption><thead align="left"><tr id="apig-en-ug-180307029__row59587116512"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.4.2.2.1.2.3.1.1"><p id="apig-en-ug-180307029__p395811175111">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="80%" id="mcps1.3.3.2.4.2.2.1.2.3.1.2"><p id="apig-en-ug-180307029__p1095881185112">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="apig-en-ug-180307029__row495831117515"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p11958411115112">Name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p0958111113512">Request throttling policy name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="apig-en-ug-180307029__row695851165120"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p139581911155114">Type</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p9958151125114">API-based or API-shared request throttling.</p>
|
|
<ul id="apig-en-ug-180307029__ul2095891110515"><li id="apig-en-ug-180307029__li2958191195114"><strong id="apig-en-ug-180307029__en-us_topic_0080103329_b2745233132315">API-based</strong>: Request throttling is based on every API to which the policy is bound.</li><li id="apig-en-ug-180307029__li89589114519"><strong id="apig-en-ug-180307029__en-us_topic_0080103329_b585784482511">API-shared</strong>: Request throttling is based on all APIs as a whole to which the policy is bound.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="apig-en-ug-180307029__row12959161125112"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p12958111145119">Period</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p1295811175112">For how long you want to limit the number of API calls. This parameter can be used together with the following parameters:</p>
|
|
<ul id="apig-en-ug-180307029__ul9959211115115"><li id="apig-en-ug-180307029__li8959111125111"><strong id="apig-en-ug-180307029__en-us_topic_0080103329_b58995364297">Max. API Requests</strong>: Limit the maximum number of times an API can be called within a specific period.</li><li id="apig-en-ug-180307029__li1895921125114"><strong id="apig-en-ug-180307029__en-us_topic_0080103329_b71821945123110">Max. User Requests</strong>: Limit the maximum number of times an API can be called by a user within a specific period.</li><li id="apig-en-ug-180307029__li695951111515"><strong id="apig-en-ug-180307029__en-us_topic_0080103329_b1797991223416">Max. App Requests</strong>: Limit the maximum number of times an API can be called by an app within a specific period.</li><li id="apig-en-ug-180307029__li195941113519"><strong id="apig-en-ug-180307029__en-us_topic_0080103329_b20167313153517">Max. IP Address Requests</strong>: Limit the maximum number of times an API can be called by an IP address within a specific period.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="apig-en-ug-180307029__row18959181113511"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p12959161195116">Max. API Requests</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p189598114519">The maximum number of times each bound API can be called within the specified period.</p>
|
|
<p id="apig-en-ug-180307029__p18959611175114">This parameter must be used together with <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b155138322187">Period</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="apig-en-ug-180307029__row1695951105120"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p895951155114">Max. User Requests</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p695918111512">The maximum number of times each bound API can be called by a user within the specified period. <strong id="apig-en-ug-180307029__b1410614013307">This limit only applies to APIs that are accessed through app or IAM authentication.</strong></p>
|
|
<ul id="apig-en-ug-180307029__ul1095971112511"><li id="apig-en-ug-180307029__li995914118518">The value of this parameter cannot exceed that of <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b57532596389">Max. API Requests</strong>.</li><li id="apig-en-ug-180307029__li295911118517">This parameter must be used together with <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b87241300713">Period</strong>.</li><li id="apig-en-ug-180307029__li295961111519">If there are many users under your account that access an API, the request throttling limits of the API will apply to all these users.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="apig-en-ug-180307029__row59591511115118"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p995911115517">Max. App Requests</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p1795910114511">The maximum number of times each bound API can be called by an app within the specified period. <strong id="apig-en-ug-180307029__b109301181940">This limit only applies to APIs that are accessed through app authentication.</strong></p>
|
|
<ul id="apig-en-ug-180307029__ul16959711155116"><li id="apig-en-ug-180307029__li1195951116519">The value of this parameter cannot exceed that of <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b1238010541478">Max. User Requests</strong>.</li><li id="apig-en-ug-180307029__li12959131115117">This parameter must be used together with <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b21961704815">Period</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="apig-en-ug-180307029__row199601113518"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p395918112519">Max. IP Address Requests</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p1959111185118">The maximum number of times each bound API can be called by an IP address within the specified period.</p>
|
|
<ul id="apig-en-ug-180307029__ul10960201195112"><li id="apig-en-ug-180307029__li1959711145118">The value of this parameter cannot exceed that of <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b1172663917">Max. API Requests</strong>.</li><li id="apig-en-ug-180307029__li7960141119511">This parameter must be used together with <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b20183114917818">Period</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="apig-en-ug-180307029__row1296081195113"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.1 "><p id="apig-en-ug-180307029__p796091105113">Description</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.3.2.4.2.2.1.2.3.1.2 "><p id="apig-en-ug-180307029__p20960101165112">Description of the request throttling policy.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</p></li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li33111754410"><span>Click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b84235270601052">OK</strong>.</span><p><p id="apig-en-ug-180307029__en-us_topic_0080103329_p29103151110">After the policy is created, it is displayed on the <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b13344133112434">Request Throttling</strong> page. You can bind this policy to APIs to throttle API requests.</p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="apig-en-ug-180307029__en-us_topic_0080103329_section1853216101881"><h4 class="sectiontitle">Binding a Request Throttling Policy to an API</h4><ol id="apig-en-ug-180307029__en-us_topic_0080103329_ol1912016431015"><li id="apig-en-ug-180307029__en-us_topic_0080103329_li1121120144610"><span>Go to the page for binding a request throttling policy to an API. You can use one of the following methods:</span><p><ul id="apig-en-ug-180307029__en-us_topic_0080103329_ul161611010467"><li id="apig-en-ug-180307029__en-us_topic_0080103329_li2161601467">In the <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b9696172795111">Operation</strong> column of the request throttling policy to be bound, click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b1069717271516">Bind to API</strong>, and then click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b1269792705110">Select API</strong>.</li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li3973105144618">Click the name of the target request throttling policy, and click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b1143813405481">Select API</strong> on the <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b12439104010489">APIs</strong> tab page.</li></ul>
|
|
</p></li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li129919201149"><span>Specify an API group, environment, and API name keyword to search for the desired API.</span></li><li id="apig-en-ug-180307029__en-us_topic_0080103329_li1918710448179"><span>Select the API and click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b219074924818">OK</strong>.</span><p><div class="note" id="apig-en-ug-180307029__en-us_topic_0080103329_note1337383012209"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="apig-en-ug-180307029__en-us_topic_0080103329_p3374173052010">If a request throttling policy is no longer needed for an API, you can unbind it. To unbind a request throttling policy from multiple APIs, select the APIs, and click <strong id="apig-en-ug-180307029__en-us_topic_0080103329_b1480434191811">Unbind</strong>. You can unbind a request throttling policy from a maximum of 1000 APIs at a time.</p>
|
|
</div></div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="apig-en-ug-180307029__en-us_topic_0080103329_section186331115191812"><h4 class="sectiontitle">Follow-Up Operations</h4><p id="apig-en-ug-180307029__en-us_topic_0080103329_p1744353017465">To control the maximum number of API calls received from a specific app or tenant, specify the app or tenant to exclude by referring to <a href="apig-en-ug-180307033.html">Adding an Excluded App or Tenant</a>. If an app is excluded in a request throttling policy, any threshold configured for that app takes precedence over the request throttling policy. The API and user request limits of this policy are still valid. If a tenant is excluded in a request throttling policy, any threshold configured for that tenant will be applied. The API and app request limits of this policy are still valid.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="apig-en-ug-180307028.html">Request Throttling</a></div>
|
|
</div>
|
|
</div>
|
|
|