You can import and export service throttling rules to apply them to multiple applications.
Export service throttling rules
Log on to the SOFAStack console.
In the navigation pane on the left, choose Middleware > Microservice Platform > Microservice > Service Governance.
Click Service Throttling. In the application list, find the target application and choose More > Export.
The exported file is in JSON format and is saved to the default download folder of your browser.

Import service throttling rules
You can import the exported rules to other applications to quickly create new service throttling rules.
On the Service Throttling page, find the target application in the application list and choose More > Import.
Click Browse, select the target file, and then click Open.
Service throttling rule file format
The exported service throttling rule file is in JSON format. The file content is as follows:
[
{
"actionConfig":{
"actionType":"LIMIT_EXCEPTION",
"responseContent":"ssssssssss"
},
"calculationConfigs":[
{
"calculationType":"INVOKE_BY_TIME",
"maxAllow":1,
"period":1000
}
],
"desc":"GuardianApp.query",
"enable":false,
"globalLimit":false,
"limitStrategy":"QpsLimiter",
"limitType":"GENERIC_LIMIT",
"maxBurstRatio":0,
"resourceConfigs":[
{
"baseName":"com.alipay.antcloud.dsrconsole.core.service.guardian.facade.GuardianAppFacade.query",
"resourceType":"METHOD",
"ruleIds":[
]
},
{
"baseName":"11.22",
"resourceType":"METHOD",
"ruleIds":[
]
}
],
"resourceType":"METHOD",
"runMode":"CONTROL",
"trafficType":"ALL"
}
]
The following table describes the parameters:
Parameter | Description |
actionConfig | The post-processing action. It includes the following parameters:
|
calculationConfigs | The throttling configuration. It includes the following parameters:
|
desc | The description of the throttling rule. |
enable | Specifies whether to enable the throttling rule. Exported rules are disabled by default. |
limitStrategy | The type of throttling algorithm. |
maxBurstRatio | The burst coefficient for the token bucket algorithm. |
resourceConfigs | The throttling object. It includes the following parameters:
|
runMode | The run mode, such as Block Mode or Monitoring Mode. |
For more information, see Add service throttling rules.