Parameters

Parameter

Type

Required

Default Value

Description

Rules

nameStringYes-Policy name

API must be unique in Proxy

targetVariableForIdentityVariableDTONo-Identity variable to be used for Throttling trackingMaximum number of requests allowed in the specified time interval
messageCountForIntervalIntegerYes-

throttlingIntervalEnumThrottleTimeIntervalYes-Throttling time interval-
cacheConnectionTimeoutInSecondsIntegerNo3Cache connection timeout (seconds)Must be greater than 0
cacheErrorHandlingTypeEnumNoFAILAction to be taken in case of cache error-

detailList

Array

No

-

Specific throttling limits are defined for each destination (e.g. user, IP)

One or more throttling limits are defined.

throttlingInterval values

Value

Description

ONE_SECONDRequest limit per second
ONE_MINUTERequest limit per minute

cacheErrorHandlingType values

Value

Description

FAILDeny request in case of cache error
CONTINUEAllow request in case of cache error

Values that can be added to detailList Array

ParemeterTypeRequiredDefault ValueDescriptionRules

targetValue

String

No

-

Target Value

-

regexExpression

Bool

No

false

Regex Expression

-

messageCountForInterval

Integer

No

-

Number of Messages for Throttling Time Interval

Must be greater than 0

intervalPeriodLength

Integer

No

-

Throttling Time Interval

Must be greater than 0

throttlingInterval

Enum

No

-

Throttling Time Unit

-

Example JSON Structures

1. IP Based Secondary Throttling

{
  "operationMetadata" : {
    "targetScope" : "ALL",
    "targetPipeline" : "REQUEST",
    "deploy" : true,
	"deployTargetEnvironmentNameList": [
      "test", "prod"
    ], 
    "order" : 1
  },
  "policy" : {
	"type" : "policy-api-based-throttling",
    "name" : "SaniyelikIpThrottling",
    "messageCountForInterval" : 10,
    "throttlingInterval" : "ONE_SECOND",
    "cacheConnectionTimeoutInSeconds" : 5,
    "cacheErrorHandlingType" : "FAIL",
    "targetVariableForIdentity" : {
      "name" : "clientIp",
      "type" : "CONTEXT_VALUES",
      "contextValue" : "REQUEST_REMOTE_ADDRESS",
      "description" : "İstemci IP adresi"
    }
  }
}
CODE

2. IP Based Secondly Throttling + User IP Based Secondly and Minute Quota

{
  "operationMetadata" : {
    "targetScope" : "ALL",
    "targetPipeline" : "REQUEST",
    "deploy" : true,
	"deployTargetEnvironmentNameList": [
      "test", "prod"
    ], 
    "order" : 1
  },
  "policy" : {
	"type" : "policy-api-based-throttling",
    "name" : "SaniyelikIpThrottling",
    "messageCountForInterval" : 10,
    "throttlingInterval" : "ONE_SECOND",
    "cacheConnectionTimeoutInSeconds" : 5,
    "cacheErrorHandlingType" : "FAIL",
    "targetVariableForIdentity" : {
      "name" : "clientIp",
      "type" : "CONTEXT_VALUES",
      "contextValue" : "REQUEST_REMOTE_ADDRESS",
      "description" : "İstemci IP adresi"
    },
	"detailList": [
      {
        "targetValue": "<IP>",
        "regexExpression": false,
        "messageCountForInterval": 20,
        "intervalPeriodLength": 1,
        "quotaInterval": "ONE_SECOND"
      },
      {
        "targetValue": "10.0.0.*",
        "regexExpression": true,
        "messageCountForInterval": 5,
        "intervalPeriodLength": 2,
        "quotaInterval": "ONE_MINUTE"
      }
    ]   
}
}
CODE

3. Minute Based Throttling

{
  "operationMetadata" : {
    "targetScope" : "ENDPOINT",
    "targetEndpoint" : "/api/v1/transactions",
    "targetEndpointHTTPMethod" : "POST",
    "targetPipeline" : "REQUEST",
    "deploy" : true,
	"deployTargetEnvironmentNameList": [
      "test", "prod"
    ], 
    "order" : 1
  },
  "policy" : {
 	"type" : "policy-api-based-throttling",
    "name" : "DakikalikApiKeyThrottling",
    "messageCountForInterval" : 60,
    "throttlingInterval" : "ONE_MINUTE",
    "cacheConnectionTimeoutInSeconds" : 3,
    "cacheErrorHandlingType" : "PASS",
    "targetVariableForIdentity" : {
      "name" : "apiKey",
      "type" : "HEADER",
      "headerName" : "X-API-KEY",
      "description" : "API Anahtarı"
    }
  }
}
CODE