Updated on 2022-02-21 GMT+08:00

Creating an Excluded Request Throttling Configuration

Function

A request throttling policy controls the maximum number of times an API can be accessed within a specified period and the maximum numbers of times the API can be accessed by a tenant or an app within the same period.

When necessary, you can create an excluded request throttling configuration to specify the threshold of API calls for a specific app. For example, after you set the API call threshold for all apps to 500 calls/minute, you can specify the API call threshold of app 1 as 800 calls/minute.

You can add excluded apps or tenants to a request throttling policy.

URI

The following table lists the HTTP/HTTPS request method and URI of the API.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

POST

/v1.0/apigw/throttle-specials

Request

Table 2 Parameter description

Parameter

Mandatory

Type

Description

call_limits

Yes

Integer

Maximum number of times the excluded object can access an API within the throttling period

instance_id

Yes

String

Excluded app ID or excluded account ID

instance_type

Yes

String

Object type, which can be APP or USER

strategy_id

Yes

String

Request throttling policy ID

Example request:

{
	"call_limits": 150,
	"instance_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4",
	"instance_type": "APP",
	"strategy_id": "a3106cfe-801f-4919-b0d7-d785dc5b47f9"
}

Response

Table 3 Parameter description

Parameter

Type

Description

id

String

Excluded request throttling configuration ID

strategy_id

String

Request throttling policy ID

instance_id

Integer

Excluded object ID

instance_name

String

Name of an app or a tenant to which the excluded request throttling configuration applies

instance_type

Integer

Type of the excluded object

call_limits

Integer

Maximum number of times the excluded object can access an API within the throttling period

apply_time

Timestamp

Time when the excluded request throttling configuration is created

app_id

String

ID of the app to which the excluded request throttling configuration applies

app_name

String

Name of the app to which the excluded request throttling configuration applies

Example response:

{
  "id": "778879b8-df10-495b-a087-874859fdea6d",
  "strategy_id": "a3106cfe-801f-4919-b0d7-d785dc5b47f9",
  "instance_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4",
  "instance_name": "app_002",
  "instance_type": "APP",
  "call_limits": 150,
  "apply_time": "2017-12-29T03: 11: 18.2698381Z",
  "app_id": "98efd77d-10b5-4eca-8170-ed30a4a286a4",
  "app_name": "app_002"
}

Status Codes

Table 4 Status codes

Status Code

Description

201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Server Internal Error