Standalone environment, then use the local API
to update the apache shenyu gateway data。
Common result:
success
Common preFix: localhost:9095/shenyu
Common Header: localKey: 123456
save or update plugin data
POST
/plugin/saveOrUpdate
Name | Type | Required | Default | Description |
---|---|---|---|---|
PluginData | PluginData | True | Plugin data object (pass Json object inside Body) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | plugin id | |
name | String | True | plugin name | |
config | String | False | plugin configuration (Json format) | |
role | String | False | plugin role | |
enabled | Boolean | False | whether to turn on |
POST body
{"id":3,"name":"divide","enabled":"true"}
Clear all data (plugins, selectors, rules)
GET
/cleanAll
Clear plugin data(selector, rule)
GET
/cleanPlugin?name = xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
name | String | true | plugin name |
Remove plugin data (not included, the selectors and rules data)
GET
/plugin/delete?name = xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
name | String | true | plugin name |
Remove all plugin data (not included, the selectors and rules data)
GET
/plugin/deleteAll
Find plugin by name
GET
/plugin/findByName?name=xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
name | String | true | plugin name |
Save or Update Selector
POST
/plugin/selector/saveOrUpdate
Name | Type | Required | Default | Description |
---|---|---|---|---|
SelectorData | SelectorData | True | Selector object (pass Json object inside Body) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | selector id | |
pluginName | String | True | plugin name | |
name | String | False | Selector name (default is plugin:selector+random number if not filled) | |
matchMode | Integer | False | Matching mode (0:and;1:or), not filled with the default generation And mode | |
type | Integer | False | Traffic type(0: full traffic; 1: custom traffic) do not fill in the default generation of full traffic | |
sort | Integer | False | Sort by, not filled by default generate 10 | |
enabled | Boolean | False | Whether to turn on, not fill in the default generation true | |
logged | Boolean | False | Whether or not to print the log, do not fill in the default generated into false | |
handle | String | False | Selector handler (Json objects, depending on each plug-in, different objects are passed) | |
conditionList | Condition | False | Conditional collection, custom traffic needs to be passed, full traffic does not need to be passed (Json List object) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
paramType | String | True | param type(post,uri,query,host,header,cookie,req_method,domain) | |
operator | String | True | operator (match,=,regex,>,<,contains,SpEL,Groovy,TimeBefore,TimeAfter) | |
paramName | String | False | param mame(The uri parameter type can be passed without) | |
paramValue | Integer | False | param value |
POST body
{ "pluginName": "divide", "type": 1, "handle": "[{\"upstreamUrl\":\"127.0.0.1:8089\"}]", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramName": null, "paramValue": "/**" }] }
Is selector id
xxxxx
Add a selector with multiple rules
POST
/plugin/selectorAndRules
Name | Type | Required | Default | Description |
---|---|---|---|---|
SelectorRulesData | SelectorRulesData | True | Selector rule object (Body inside pass Json object) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
pluginName | String | True | plugin name | |
selectorName | String | False | Selector name (if not filled in, it is generated by default plugin:selector+random number) | |
matchMode | Integer | False | Matching mode (0:and;1:or), not filled with the default generation And mode | |
selectorHandler | String | False | Selector handler (Json objects, depending on each plug-in, different objects are passed) | |
conditionList | ConditionData | True | Selector condition collection (Json List object) | |
ruleDataList | RuleLocalData | True | Rule condition collection (Json List object) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
ruleName | String | False | rule name | |
ruleHandler | String | True | Rule handler (different plugins pass different values)) | |
matchMode | Integer | False | Matching pattern (0:and;1:or) | |
conditionList | ConditionData | True | Rule condition collection (Json List object) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
paramType | String | True | param type(post,uri,query,host,header,cookie,req_method,domain) | |
operator | String | True | operator (match,=,regex,>,<,contains,SpEL,Groovy,TimeBefore,TimeAfter) | |
paramName | String | False | param mame(The uri parameter type can be passed without) | |
paramValue | Integer | False | param value |
POST body
{ "pluginName": "divide", "selectorHandler": "[{\"upstreamUrl\":\"127.0.0.1:8089\"}]", "conditionDataList": [{ "paramType": "uri", "operator": "match", "paramValue": "/http/**" }], "ruleDataList": [{ "ruleHandler": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "=", "paramValue": "/http/test/payment" }] }, { "ruleHandler": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "=", "paramValue": "/http/order/save" }] }] }
Delete selectors based on selector id and plugin name
GET
/plugin/selector/delete?pluginName=xxxx&&id=xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
pluginName | String | true | plugin name | |
id | String | true | selector id |
Get all selectors by plugin name
GET
/plugin/selector/findList?pluginName=xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
pluginName | String | true | plugin name |
Save or Update Rule Data
POST
/plugin/rule/saveOrUpdate
Name | Type | Required | Default | Description |
---|---|---|---|---|
RuleData | RuleData | True | Rule object (pass Json object inside Body) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | rule id | |
pluginName | String | True | plugin name | |
name | String | False | Rule name (default generation if not filled plugin:rule+random number) | |
selectorId | String | True | Selector id | |
matchMode | Integer | False | Matching mode (0:and;1:or), not filled with the default generation And mode | |
sort | Integer | False | Sort by , not filled by default generate 10 | |
enabled | Boolean | False | Whether to turn on, not fill in the default generation true | |
logged | Boolean | False | Whether or not to print the log, do not fill in the default generated into false | |
handle | String | False | Rule handler (Json objects, depending on each plug-in, different objects are passed) | |
conditionList | ConditionData | False | Conditional collections (Json List objects) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
paramType | String | True | param type(post,uri,query,host,header,cookie,req_method,domain) | |
operator | String | True | operator (match,=,regex,>,<,contains,SpEL,Groovy,TimeBefore,TimeAfter) | |
paramName | String | False | param mame(The uri parameter type can be passed without) | |
paramValue | Integer | False | param value |
POST body
{ "pluginName": "divide", "selectorId": 123456, "handle": "{\"loadBalance\":\"random\"}", "conditionDataList": [{ "paramType": "uri", "operator": "=", "paramValue": "/test" }] }
Is rule id
xxxxx
Delete rules based on selector id and rule id
GET
/plugin/rule/delete?selectorId=xxxx&&id=xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
selectorId | String | true | selector ID | |
id | String | true | rule ID |
Get all rules by selector ID
GET
/plugin/rule/findList?selectorId=xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
selectorId | String | true | selector id |
Save Or Update Meta data
POST
/meta/saveOrUpdate
Name | Type | Required | Default | Description |
---|---|---|---|---|
MetaData | MetaData | True | Metadata object (pass Json object inside Body) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
id | String | False | ID | |
appName | String | True | app name | |
contextPath | String | True | contextPath | |
path | String | True | path | |
rpcType | String | True | rpc type(dubbo,sofa,tars,springCloud,motan,grpc) | |
serviceName | String | True | service name | |
methodName | String | True | method name | |
parameterTypes | String | True | parameter types | |
rpcExt | String | False | rpc extension parameters (json objects) | |
enabled | Boolean | False | Whether to turn on |
Delete Meta data
GET
/meta/delete?rpcType=xxxx&&path=xxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
rpcType | String | true | rpc type(dubbo,sofa,tars,springCloud,motan,grpc) | |
path | String | true | path |
Save Or Update App Sign Data
POST
/auth/saveOrUpdate
Name | Type | Required | Default | Description |
---|---|---|---|---|
AppAuthData | AppAuthData | True | Signature object (Json object passed inside the Body) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
appKey | String | True | app key | |
appSecret | String | True | app secret | |
enabled | Boolean | False | Whether to turn on | |
open | Boolean | False | is open | |
paramDataList | AuthParamData | false | Parameter set, open is true when you need to pass (Json list object) | |
AuthPathData | AuthPathData | false | Path collection, open is true when you need to pass (Json list object) |
Name | Type | Required | Default | Description |
---|---|---|---|---|
appName | String | True | app name | |
appParam | String | True | app param |
Name | Type | Required | Default | Description |
---|---|---|---|---|
appName | String | True | app name | |
path | String | True | path | |
enabled | Boolean | False | Whether to turn on |
Delete App Sign Data
GET
/auth/delete?appKey=xxxx
Name | Type | Required | Default | Description |
---|---|---|---|---|
appKey | String | true | app key |